Class StateEncoder
Object
StateEncoder
Encapsulates encoding and restoration of EvoLudo engine state, including
version handling.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionStateEncoder(EvoLudo engine) Create a state encoder for the supplied engine. -
Method Summary
Modifier and TypeMethodDescriptionEncode current state of EvoLudo model as XML string (plist format).Return version string of current model.booleanrestoreState(Plist plist) Restore state of EvoLudo model from pre-processed plist, which encodes engine state (seeencodeState()).
-
Field Details
-
engine
Owning runtime whose state will be encoded.
-
-
Constructor Details
-
StateEncoder
Create a state encoder for the supplied engine.- Parameters:
engine- EvoLudo runtime
-
-
Method Details
-
getVersion
Return version string of current model. Version must include reference to git commit to ensure reproducibility of results.- Returns:
- the version string
-
encodeState
Encode current state of EvoLudo model as XML string (plist format).- Returns:
- encoded state
-
restoreState
Restore state of EvoLudo model from pre-processed plist, which encodes engine state (seeencodeState()).Note: the appropriate model must already have been loaded and the command line arguments specified with the key
CLOin theplistmust also have been processed already.In JRE the options in
plistare merged with any other command line arguments (albeit the ones inplisthave priority to minimize the chance of complications). In GWTrestoreState(Plist)is overridden to first deal with the command line arguments.- Parameters:
plist- the lookup table with key value pairs- Returns:
trueon successfully restoring state
-