All Downloads are FREE. Search and download functionalities are using the official Maven repository.

alloy-ggp-base.0.0.15.source-code.scripts.py Maven / Gradle / Ivy

The newest version!
# This is a library of short scripts for use in the Python console.
# These should make is easier to experiment with the GGP base classes
# from a Python command line.
#
# -Sam

from org.ggp.base.util.game import GameRepository
from org.ggp.base.util.statemachine.implementation.prover import ProverStateMachine

def load_game(game_name):
    game_description = GameRepository.getDefaultRepository().getGame(game_name).getRules()
    machine = ProverStateMachine()
    machine.initialize(game_description)
    return machine
    
def display_random_walk(machine):
    state = machine.getInitialState()
    while not machine.isTerminal(state):
        print state
        state = machine.getRandomNextState(state)




© 2015 - 2025 Weber Informatics LLC | Privacy Policy