alloy-ggp-base.0.0.15.source-code.sample_gamer.clj 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!
(ns gamer_namespace
(:import [org.ggp.base.player.gamer.statemachine StateMachineGamer]
[org.ggp.base.util.statemachine.implementation.prover ProverStateMachine]))
;; An implementation of a sample random gamer in Clojure.
;; -Sam Schreiber
(defn SampleClojureGamer []
(proxy [StateMachineGamer] []
;; NOTE: the implicit 'this symbol is bound to the local class.
(getInitialStateMachine []
(ProverStateMachine.))
(stateMachineSelectMove [timeout]
(let [state-machine (.getStateMachine this)
current-state (.getCurrentState this)
role (.getRole this)
random-move (.getRandomMove state-machine
current-state
role)]
random-move))
(stateMachineMetaGame [timeout]
(println "SampleClojureGamer metagame called"))
(stateMachineAbort []
(println "SampleClojureGamer abort called"))
(stateMachineStop []
(println "SampleClojureGamer stop called"))))