public abstract class SerializableState
extends java.lang.Object
implements java.io.Serializable
State objects into
an object that can be trivially serialized by using the serialize(burlap.oomdp.core.states.State)
method. This class does not implement the
State interface, because the serializable states do not have to reference specific
Domain instances or ObjectClass for easy file portability.
Instead, a SerializableState is deserialized into an actual State
object by calling the deserialize(burlap.oomdp.core.Domain) method, which takes the Domain
into which the state should be unpacked. There is also a static method deserializeStates(java.util.List, burlap.oomdp.core.Domain)
which takes a List of SerializableState objects and turns it
into a List of State objects by calling the deserialize(burlap.oomdp.core.Domain)
method of each element.
SerializableState objects should be constructed with a
SerializableStateFactory.
ObjectInstance
and Value objects returned by a State and explicitly
representing their information is the
SimpleSerializableState and its corresponding
SimpleSerializableStateFactory.| Constructor and Description |
|---|
SerializableState() |
SerializableState(State s)
Constructs and serializes the input
State by calling this object's
serialize(burlap.oomdp.core.states.State) method. |
| Modifier and Type | Method and Description |
|---|---|
abstract State |
deserialize(Domain domain)
Unpacks this
SerializableState into an actual State
in which the ObjectClass, Attribute and other Domain
information refers to the provided Domain. |
static java.util.List<State> |
deserializeStates(java.util.List<SerializableState> serializableStates,
Domain domain)
Takes a
List of SerializableState objects and calls the deserialize(burlap.oomdp.core.Domain)
method on them to turn it into a List of State objects. |
abstract void |
serialize(State s)
Causes this object to be a serializable representation of the input
State |
public SerializableState()
public SerializableState(State s)
State by calling this object's
serialize(burlap.oomdp.core.states.State) method.s - the input State to serialize.public abstract void serialize(State s)
States - the State to be represented by this object.public abstract State deserialize(Domain domain)
SerializableState into an actual State
in which the ObjectClass, Attribute and other Domain
information refers to the provided Domain.domain - The Domain specifying ObjectClass and Attribute information.State corresponding to this SerializableStatepublic static java.util.List<State> deserializeStates(java.util.List<SerializableState> serializableStates, Domain domain)
List of SerializableState objects and calls the deserialize(burlap.oomdp.core.Domain)
method on them to turn it into a List of State objects.serializableStates - the List of SerializableState instances to deserialize.domain - the Domain to which all produced State objects will be associated.List of State objects.