Package repast.simphony.scenario.data
Class ContextData
java.lang.Object
repast.simphony.scenario.data.AttributeContainer
repast.simphony.scenario.data.ContextData
Encapsulates the context heirarchy.
- Author:
- Nick Collier
-
Field Summary
Fields inherited from class repast.simphony.scenario.data.AttributeContainer
attributes, id
-
Constructor Summary
ConstructorDescriptionContextData
(String id, String contextClassName, Classpath classpath) ContextData
(String id, Classpath classpath) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the class name of an agent contained by this context to this ContextData.addProjection
(String id, String type) void
addSubContext
(ContextData child) Finds and returns the ContextData with the specified id.getAgentClasses
(boolean includeSubContexts) Gets a list of the agent classes specified in this ContextData and optionally those is all its decendent subclasses as well.int
getAgentData
(boolean includeSubContexts) Gets a list of the agent class names specified in this ContextData and optionally those is all its decendent subclasses as well.getAgentData
(int index) Gets a list which includes this ContextData and all of its decendents.Gets the classpath associated with this ContextData heirarchy.Gets the name of the class to use a Context, or null if the default should be used.getProjection
(int index) int
getSubContext
(int index) int
Gets an iterable over all the ProjectionData-s contained by this ContextData.Gets an iterable over the sub-context data of this ContextData.Methods inherited from class repast.simphony.scenario.data.AttributeContainer
addAttribute, attributes, getAttributeCount, getId
-
Constructor Details
-
ContextData
-
ContextData
-
-
Method Details
-
getContextClassName
Gets the name of the class to use a Context, or null if the default should be used.- Returns:
- the name of the class to use a Context, or null if the default should be used.
-
addProjection
-
addSubContext
-
getClasspath
Gets the classpath associated with this ContextData heirarchy.- Returns:
- the classpath associated with this ContextData heirarchy.
-
find
Finds and returns the ContextData with the specified id. This attempts to match against this context and all its decendents.- Parameters:
contextId
- the id of ContextData to find.- Returns:
- the ContextData with the specified id.
-
addAgent
Adds the class name of an agent contained by this context to this ContextData.- Parameters:
agentClass
- the agent class to add
-
getAgentClasses
Gets a list of the agent classes specified in this ContextData and optionally those is all its decendent subclasses as well.- Parameters:
includeSubContexts
- if true then agents classes specified in sub contexts will be included.- Returns:
- a list of the agent classes.
-
getAgentData
Gets a list of the agent class names specified in this ContextData and optionally those is all its decendent subclasses as well.- Parameters:
includeSubContexts
- if true then agents class names specified in sub contexts will be included.- Returns:
- a list of the agent class names.
-
getAllContexts
Gets a list which includes this ContextData and all of its decendents.- Returns:
- a list which includes this ContextData and all of its decendents.
-
subContexts
Gets an iterable over the sub-context data of this ContextData.- Returns:
- an iterable over the sub-context data of this ContextData.
-
getAgentCount
public int getAgentCount() -
getAgentData
-
getSubContextCount
public int getSubContextCount() -
getProjectionCount
public int getProjectionCount() -
getSubContext
-
getProjection
-
projections
Gets an iterable over all the ProjectionData-s contained by this ContextData.- Returns:
- an iterable over all the ProjectionData-s contained by this ContextData.
-