Class ContextData

java.lang.Object
repast.simphony.scenario.data.AttributeContainer
repast.simphony.scenario.data.ContextData

public class ContextData extends AttributeContainer
Encapsulates the context heirarchy.
Author:
Nick Collier
  • Constructor Details

  • Method Details

    • getContextClassName

      public String 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

      public ProjectionData addProjection(String id, String type)
    • addSubContext

      public void addSubContext(ContextData child)
    • getClasspath

      public Classpath getClasspath()
      Gets the classpath associated with this ContextData heirarchy.
      Returns:
      the classpath associated with this ContextData heirarchy.
    • find

      public ContextData find(String contextId)
      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

      public void addAgent(String agentClass)
      Adds the class name of an agent contained by this context to this ContextData.
      Parameters:
      agentClass - the agent class to add
    • getAgentClasses

      public List<Class<?>> getAgentClasses(boolean includeSubContexts)
      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

      public List<AgentData> 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.
      Parameters:
      includeSubContexts - if true then agents class names specified in sub contexts will be included.
      Returns:
      a list of the agent class names.
    • getAllContexts

      public List<ContextData> 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

      public Iterable<ContextData> 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

      public AgentData getAgentData(int index)
    • getSubContextCount

      public int getSubContextCount()
    • getProjectionCount

      public int getProjectionCount()
    • getSubContext

      public ContextData getSubContext(int index)
    • getProjection

      public ProjectionData getProjection(int index)
    • projections

      public Iterable<ProjectionData> 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.