public abstract class Domain
extends java.lang.Object
Attribute
s, ObjectClass
s, and PropositionalFunction
s),
and the physics of the world, which are typically specified with some set of action definitions. For single-agent
domains, the physics and actions are defined with the Action
object and for
multi-agent stochastic games, they are defined with SGAgentAction
and a
JointActionModel
. See the respective single-agent SADomain
and stochastic games SGDomain
subclasses for more information on their definitions.
Domain
does *not* include task information, which will be defined separately with
a RewardFunction
or JointReward
, and a TerminalFunction
.Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.String,Attribute> |
attributeMap |
protected java.util.List<Attribute> |
attributes |
protected int |
debugCode |
protected java.util.List<ObjectClass> |
objectClasses |
protected java.util.Map<java.lang.String,ObjectClass> |
objectClassMap |
protected boolean |
objectIdentifierDependentDomain |
protected java.util.Map<java.lang.String,PropositionalFunction> |
propFunctionMap |
protected java.util.List<PropositionalFunction> |
propFunctions |
Constructor and Description |
---|
Domain()
Initializes the data structures for indexing the object classes, attributes, and propositional functions
|
Modifier and Type | Method and Description |
---|---|
abstract void |
addAction(Action act)
Add a single agent action that defines this domain.
|
void |
addAttribute(Attribute att)
Add an attribute that can be used to define object classes of this domain.
|
void |
addObjectClass(ObjectClass oc)
Add an object class to define this domain.
|
void |
addPropositionalFunction(PropositionalFunction prop)
Add a propositional function that can be used to evaluate objects that belong to object classes
of this domain.
|
abstract void |
addSGAgentAction(SGAgentAction sa)
Add a
SGAgentAction that can be executed by an agent in the game. |
abstract Action |
getAction(java.lang.String name)
Returns the single agent action with the given name.
|
abstract java.util.List<Action> |
getActions()
Returns a list of the single agent actions that define this domain.
|
abstract java.util.List<SGAgentAction> |
getAgentActions()
Returns a list of the stochastic game actions that that can be taken by individual agents in this domain.
|
Attribute |
getAttribute(java.lang.String name)
Returns the attribute in this domain with the given name
|
java.util.List<Attribute> |
getAttributes()
Returns a list of the attributes that define this domain.
|
int |
getDebugCode()
Returns the debug code used for printing debug messages.
|
Domain |
getNewDomainWithCopiedObjectClasses()
This will return a new domain object populated with copies of this Domain's ObjectClasses.
|
ObjectClass |
getObjectClass(java.lang.String name)
Returns the object class in this domain with the given name.
|
java.util.List<ObjectClass> |
getObjectClasses()
Returns the list of object classes that define this domain.
|
PropositionalFunction |
getPropFunction(java.lang.String name)
Returns the propositional function in this domain with the given name
|
java.util.List<PropositionalFunction> |
getPropFunctions()
Returns a list of the propositional functions that define this domain.
|
java.util.Map<java.lang.String,java.util.Set<PropositionalFunction>> |
getPropositionlFunctionsFromObjectClass(java.lang.String objectClassName)
Returns a map of propositional function classes to the set of propositional functions that belong to that class, but
only includes propositional function classes that define propositional functions that operate on a given object
class parameter.
|
java.util.Map<java.lang.String,java.util.Set<PropositionalFunction>> |
getPropositionlFunctionsMap()
Returns a map of propositional function classes to the set of propositional functions that belong to that class.
|
abstract SGAgentAction |
getSGAgentAction(java.lang.String name)
Return the stochastic game action (
SGAgentAction ) with the given name. |
abstract SGAgentAction |
getSingleAction(java.lang.String name)
Deprecated.
|
boolean |
isObjectIdentifierDependent()
Returns whether this domain's states are object identifier (name) dependent.
|
protected abstract Domain |
newInstance()
Will return a new instance of this Domain's class (either SADomain or SGDomain)
|
void |
setDebugCode(int debugCode)
Sets the debug code used for printing debug messages.
|
void |
setObjectIdentiferDependence(boolean objectIdentifierDependent)
Sets whether this domain's states are object identifier (name) dependent.
|
void |
toggleDebugPrinting(boolean debugPrintingOn)
Toggles whether debug messages are printed
|
protected java.util.List<ObjectClass> objectClasses
protected java.util.Map<java.lang.String,ObjectClass> objectClassMap
protected java.util.List<Attribute> attributes
protected java.util.Map<java.lang.String,Attribute> attributeMap
protected java.util.List<PropositionalFunction> propFunctions
protected java.util.Map<java.lang.String,PropositionalFunction> propFunctionMap
protected boolean objectIdentifierDependentDomain
protected int debugCode
public Domain()
public void setObjectIdentiferDependence(boolean objectIdentifierDependent)
objectIdentifierDependent
- sets whether this domain's states are object identifier dependent (true) or not (false).public boolean isObjectIdentifierDependent()
protected abstract Domain newInstance()
public Domain getNewDomainWithCopiedObjectClasses()
public void addObjectClass(ObjectClass oc)
oc
- the object class to add to this domain.public void addAttribute(Attribute att)
att
- the attribtue to add to this domain.public void addPropositionalFunction(PropositionalFunction prop)
prop
- the propositional function to add.public abstract void addAction(Action act)
act
- the single agent action to add.public abstract void addSGAgentAction(SGAgentAction sa)
SGAgentAction
that can be executed by an agent in the game.
The set of SGAgentAction
s defines the set of joint actions in the stochastic domain (as the cross product).
This method will throw a runtime exception if this domain is not an instance of the stochastic
game domain (SGDomain
). The action will not be added if this domain already has a instance with the same name.sa
- the SGAgentAction
that can be executed by an agent in the game.public java.util.List<ObjectClass> getObjectClasses()
public ObjectClass getObjectClass(java.lang.String name)
name
- the name of the object class to returnpublic java.util.List<Attribute> getAttributes()
public Attribute getAttribute(java.lang.String name)
name
- the name of the attribute to returnpublic java.util.List<PropositionalFunction> getPropFunctions()
public PropositionalFunction getPropFunction(java.lang.String name)
name
- the name of the attribute to return.public abstract java.util.List<Action> getActions()
public abstract java.util.List<SGAgentAction> getAgentActions()
public abstract Action getAction(java.lang.String name)
name
- the name of the action to return@Deprecated public abstract SGAgentAction getSingleAction(java.lang.String name)
getSGAgentAction(String)
instead.name
- the name of the action to returnpublic abstract SGAgentAction getSGAgentAction(java.lang.String name)
SGAgentAction
) with the given name.
This method will throw a runtime exception
if it is not an instance of the stochastic game domain (SGDomain).name
- the name of the action to returnSGAgentAction
with the given name or null if it does not exist.public java.util.Map<java.lang.String,java.util.Set<PropositionalFunction>> getPropositionlFunctionsMap()
public java.util.Map<java.lang.String,java.util.Set<PropositionalFunction>> getPropositionlFunctionsFromObjectClass(java.lang.String objectClassName)
objectClassName
- the name of the object class for which propositional function classes should be returnedpublic int getDebugCode()
public void setDebugCode(int debugCode)
debugCode
- the debug code used for printing debug messagespublic void toggleDebugPrinting(boolean debugPrintingOn)
debugPrintingOn
- if true debug messages are printed; messages will not be printed if false.