![JAR search and dependency download from the Maven repository](/logo.png)
alloy-ggp-base.0.0.15.source-code.scripts.py Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of alloy-ggp-base Show documentation
Show all versions of alloy-ggp-base Show documentation
A modified version of the GGP-Base library for Alloy.
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