Package repast.simphony.essentials
Class RepastEssentials
java.lang.Object
repast.simphony.essentials.RepastEssentials
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ContextAddAgentToContext(String parentContextPath, Object agent) static voidAddValueLayer(String contextPath, ValueLayer layer) Adds the specified value layer to the context on the specified path.static double[]bigDecimalArrayToDoubleArray(BigDecimal[] bigDecimalArray) static int[]bigDecimalArrayToIntArray(BigDecimal[] bigDecimalArray) static IActionCancelAction(ISchedulableAction actionToCancel) static NetworkCreate1DLatticeNetwork(String parentContextPath, String networkName, boolean directed, boolean toroidal, boolean symmetrical) static NetworkCreate2DLatticeNetwork(String parentContextPath, String networkName, boolean directed, boolean toroidal) static ObjectCreateAgent(String parentContextPath, String newAgentType) static ObjectCreateAgents(String parentContextPath, String newAgentType, int agentCount) static ContextCreateContext(String parentContextPath, String newContextName) static ContinuousSpaceCreateContinuousSpace(String parentContextPath, String newProjectionName, String borders, int... dimensions) static ContinuousSpaceCreateContinuousSpace(String parentContextPath, String newProjectionName, String borders, BigDecimal... dimensions) static ContinuousValueLayerCreateContinuousValueLayer(String contextPath, String name, double... dimensions) Creates a ContinousValueLayer and adds it to the specified context.static ContinuousValueLayerCreateContinuousValueLayer(String contextPath, String name, BigDecimal... dimensions) static RepastEdge<?>CreateEdge(String networkProjectionPath, Object agentSource, Object agentTarget) static RepastEdge<?>CreateEdge(String networkProjectionPath, Object agentSource, Object agentTarget, double optionalWeight) static GridCreateGrid(String parentContextPath, String newProjectionName, String borders, int... dimensions) static GridCreateGrid(String parentContextPath, String newProjectionName, String borders, BigDecimal... dimensions) static GridValueLayerCreateGridValueLayer(String contextPath, String name, int... dimensions) Creates a GridValueLayer and adds it to the specified context.static GridValueLayerCreateGridValueLayer(String contextPath, String name, BigDecimal... dimensions) static NetworkCreateNetwork(String parentContextPath, String netName, boolean isDirected) static NetworkCreateNetwork(String parentContextPath, String netName, boolean isDirected, String agentClassName, String fileName, NetworkFileFormat format) static NetworkCreateNetwork(String parentContextPath, String networkName, boolean directed, NetworkGenerator gen) static ProjectionCreateProjection(String parentContextPath, String newProjectionName, String newProjectionType) static ProjectionCreateProjection(String parentContextPath, String newProjectionName, String newProjectionType, boolean optionalProjectionKind) static ProjectionCreateProjection(String parentContextPath, String newProjectionName, String newProjectionType, boolean optionalProjectionKind, String optionalBorders, int... optionalDimensions) static ProjectionCreateProjection(String parentContextPath, String newProjectionName, String newProjectionType, int... optionalDimensions) static ProjectionCreateProjection(String parentContextPath, String newProjectionName, String newProjectionType, String optionalBorders, int... optionalDimensions) static ProjectionCreateProjection(String parentContextPath, String newProjectionName, String newProjectionType, String optionalBorders, BigDecimal... optionalDimensions) static ProjectionCreateProjection(String parentContextPath, String newProjectionName, String newProjectionType, BigDecimal... optionalDimensions) static NetworkCreateRandomDensityNetwork(String parentContextPath, String networkName, boolean directed, double density, boolean allowSelfLoops, boolean symmetric) static NetworkCreateWattsBetaSmallWorldNetwork(String parentContextPath, String networkName, boolean directed, double beta, int nghSize, boolean symmetrical) static NetworkCreateWattsBetaSmallWorldNetwork(String parentContextPath, String networkName, boolean directed, double beta, BigDecimal nghSize, boolean symmetrical) static booleanDeleteExternalFile(String fileName) static voidstatic voidEndSimulationRunAt(double tick) static intExecuteProgram(String directory, String commandLine) static ListFindAgentsInContext(String contextPath, String sqlQuery) static ListFindAgentsInContext(String contextPath, String sqlQuery, Object functionHandler) static ListFindAgentsInNetwork(String contextPath, String sqlQuery) static ListFindAgentsInNetwork(String networkPath, String sqlQuery, Object functionHandler) static ContextFindContext(String contextPath) static ContinuousSpaceFindContinuousSpace(String spacePath) Finds the Continuous Space projection from the given path.static RepastEdgestatic GridFinds the Grid projection from the given path.static NetworkFindNetwork(String networkPath) Finds the Network projection from the given path.static ContextFindParentContext(String contextPath) static ProjectionFindProjection(String projectionPath) static ValueLayerFindValueLayer(String valueLayerPath) Finds the ValueLayer that matches the specified path.static ListGetAdjacent(String networkPath, Object agent) Gets the agents adjacent to the specified agent in the specified network.static List<RepastEdge>Gets the edges connected to the specified agent in the specified network.static doubleGetEdgeWeight(String networkProjectionPath, Object agentSource, Object agentTarget) static List<RepastEdge>GetInEdges(String networkPath, Object agent) Gets the edges for which the specified agent is the target in the specified network.static IndexedIterableGetObjects(String contextPath, String className) static List<RepastEdge>GetOutEdges(String networkPath, Object agent) Gets the edges for which the specified agent is the source in the specified network.static ObjectGetParameter(String name) Gets the named parameter's value.static ListGetPredecessors(String networkPath, Object agent) Gets the predecessors of the specified agent in the specified network.static IterableGetRandomObjects(String contextPath, String className, long num) static ListGetSuccessors(String networkPath, Object agent) Gets the successors of the specified agent in the specified network.static doublestatic javax.measure.Quantity<?>static booleanstatic voidMoveAgentByDisplacement(String projectionPath, Object agent, Number... displacement) static voidMoveAgentByVector(String projectionPath, Object agent, Number distance, Number... anglesInRadians) static Querystatic voidstatic voidPauseSimulationRunAt(double tick) static doublestatic doubleRandomDraw(double lowerBound, double upperBound) static doubleRandomDraw(BigDecimal lowerBound, BigDecimal upperBound) static booleanRandomDrawAgainstThreshold(double threshold) static booleanRandomDrawAgainstThreshold(BigDecimal threshold) static booleanReadExternalFile(Object target, String xmlDataFileDescriptionFileName, String sourceFileName) static ContextRemoveAgentFromContext(String parentContextPath, Object agent) static ContextRemoveAgentFromModel(Object agent) static ContextRemoveContext(String contextPath) static RepastEdgeRemoveEdge(String networkProjectionPath, Object agentSource, Object agentTarget) static ProjectionRemoveProjection(String path) static ISchedulableActionScheduleAction(Object agent, double optionalStartTime, double optionalRepeatInterval, String methodName, Object... parameters) static ISchedulableActionScheduleAction(Object agent, double optionalStartTime, String methodName, Object... parameters) static ISchedulableActionScheduleAction(Object agent, String methodName, Object... parameters) static RepastEdgeSetEdgeWeight(String networkProjectionPath, Object agentSource, Object agentTarget, double newWeight) static booleanWriteExternalFile(Object source, String xmlDataFileDescriptionFileName, String targetFileName)
-
Field Details
-
serialVersionUID
public static final long serialVersionUID- See Also:
-
-
Constructor Details
-
RepastEssentials
public RepastEssentials()
-
-
Method Details
-
FindAgentsInContext
-
FindAgentsInContext
-
FindAgentsInNetwork
-
FindAgentsInNetwork
-
FindContext
-
GetObjects
-
GetRandomObjects
-
FindParentContext
-
FindValueLayer
Finds the ValueLayer that matches the specified path. The first part of the path is the context heirarchy and the last element is the value layer name.- Parameters:
valueLayerPath- the path to the value layer- Returns:
- the found value layer.
-
AddValueLayer
Adds the specified value layer to the context on the specified path.- Parameters:
contextPath- the path to the contextlayer- the value layer to add
-
CreateGridValueLayer
public static GridValueLayer CreateGridValueLayer(String contextPath, String name, BigDecimal... dimensions) -
CreateGridValueLayer
public static GridValueLayer CreateGridValueLayer(String contextPath, String name, int... dimensions) Creates a GridValueLayer and adds it to the specified context.- Parameters:
contextPath-name-dimensions-- Returns:
- the created GridValueLayer.
-
CreateContinuousValueLayer
public static ContinuousValueLayer CreateContinuousValueLayer(String contextPath, String name, BigDecimal... dimensions) -
CreateContinuousValueLayer
public static ContinuousValueLayer CreateContinuousValueLayer(String contextPath, String name, double... dimensions) Creates a ContinousValueLayer and adds it to the specified context.- Parameters:
contextPath-name-dimensions-- Returns:
- the created ContinuousValueLayer.
-
FindProjection
-
FindNetwork
Finds the Network projection from the given path.- Parameters:
networkPath- the path of the Network- Returns:
- the Network
-
FindGrid
Finds the Grid projection from the given path.- Parameters:
gridPath- the path of the Grid- Returns:
- the Grid
-
FindContinuousSpace
Finds the Continuous Space projection from the given path.- Parameters:
spacePath- the path of the Space- Returns:
- the Continuous Space
-
CreateContext
-
RemoveContext
-
CreateRandomDensityNetwork
-
Create1DLatticeNetwork
-
Create2DLatticeNetwork
-
CreateWattsBetaSmallWorldNetwork
public static Network CreateWattsBetaSmallWorldNetwork(String parentContextPath, String networkName, boolean directed, double beta, BigDecimal nghSize, boolean symmetrical) -
CreateWattsBetaSmallWorldNetwork
-
CreateNetwork
-
CreateNetwork
public static Network CreateNetwork(String parentContextPath, String networkName, boolean directed, NetworkGenerator gen) -
CreateNetwork
-
CreateGrid
public static Grid CreateGrid(String parentContextPath, String newProjectionName, String borders, BigDecimal... dimensions) -
CreateGrid
-
CreateContinuousSpace
public static ContinuousSpace CreateContinuousSpace(String parentContextPath, String newProjectionName, String borders, BigDecimal... dimensions) -
CreateContinuousSpace
public static ContinuousSpace CreateContinuousSpace(String parentContextPath, String newProjectionName, String borders, int... dimensions) -
CreateProjection
public static Projection CreateProjection(String parentContextPath, String newProjectionName, String newProjectionType) -
CreateProjection
public static Projection CreateProjection(String parentContextPath, String newProjectionName, String newProjectionType, boolean optionalProjectionKind) -
CreateProjection
public static Projection CreateProjection(String parentContextPath, String newProjectionName, String newProjectionType, BigDecimal... optionalDimensions) -
CreateProjection
public static Projection CreateProjection(String parentContextPath, String newProjectionName, String newProjectionType, int... optionalDimensions) -
CreateProjection
public static Projection CreateProjection(String parentContextPath, String newProjectionName, String newProjectionType, String optionalBorders, BigDecimal... optionalDimensions) -
CreateProjection
public static Projection CreateProjection(String parentContextPath, String newProjectionName, String newProjectionType, String optionalBorders, int... optionalDimensions) -
CreateProjection
public static Projection CreateProjection(String parentContextPath, String newProjectionName, String newProjectionType, boolean optionalProjectionKind, String optionalBorders, int... optionalDimensions) - Parameters:
parentContextPath-newProjectionName-newProjectionType-optionalProjectionKind- if net then specified isDirected, if grid then specified is mult. occupancyoptionalBorders-optionalDimensions-- Returns:
-
RemoveProjection
-
CreateAgent
-
CreateAgents
-
CreateEdge
public static RepastEdge<?> CreateEdge(String networkProjectionPath, Object agentSource, Object agentTarget) -
CreateEdge
public static RepastEdge<?> CreateEdge(String networkProjectionPath, Object agentSource, Object agentTarget, double optionalWeight) -
FindEdge
public static RepastEdge FindEdge(String networkProjectionPath, Object agentSource, Object agentTarget) -
GetEdgeWeight
-
SetEdgeWeight
public static RepastEdge SetEdgeWeight(String networkProjectionPath, Object agentSource, Object agentTarget, double newWeight) -
RemoveEdge
public static RepastEdge RemoveEdge(String networkProjectionPath, Object agentSource, Object agentTarget) -
GetPredecessors
Gets the predecessors of the specified agent in the specified network.- Parameters:
networkPath- the path to the networkagent- the agent whose predecessors we want- Returns:
- the predecessors of the specified agent in the specified network.
-
GetSuccessors
Gets the successors of the specified agent in the specified network.- Parameters:
networkPath- the path to the networkagent- the agent whose successors we want- Returns:
- the successors of the specified agent in the specified network.
-
GetAdjacent
Gets the agents adjacent to the specified agent in the specified network.- Parameters:
networkPath- the path to the networkagent- the agent whose adjacents we want- Returns:
- the agents adjacent to the specified agent in the specified network.
-
GetInEdges
Gets the edges for which the specified agent is the target in the specified network. For a undirected net this is all the edges connected to the agent.- Parameters:
networkPath- the path to the networkagent- the agent whose in edges we want- Returns:
- the edges for which the specified agent is the target in the specified network
-
GetOutEdges
Gets the edges for which the specified agent is the source in the specified network. For a undirected net this is all the edges connected to the agent.- Parameters:
networkPath- the path to the networkagent- the agent whose in edges we want- Returns:
- the edges for which the specified agent is the source in the specified network
-
GetEdges
Gets the edges connected to the specified agent in the specified network.- Parameters:
networkPath- the path to the networkagent- the agent whose in edges we want- Returns:
- the edges connected to the specified agent in the specified network.
-
AddAgentToContext
-
RemoveAgentFromContext
-
RemoveAgentFromModel
-
MoveAgent
-
MoveAgentByDisplacement
-
MoveAgentByVector
-
GetTickCount
public static double GetTickCount() -
GetTickCountInTimeUnits
public static javax.measure.Quantity<?> GetTickCountInTimeUnits() -
ScheduleAction
public static ISchedulableAction ScheduleAction(Object agent, String methodName, Object... parameters) -
ScheduleAction
public static ISchedulableAction ScheduleAction(Object agent, double optionalStartTime, String methodName, Object... parameters) -
ScheduleAction
public static ISchedulableAction ScheduleAction(Object agent, double optionalStartTime, double optionalRepeatInterval, String methodName, Object... parameters) -
CancelAction
-
EndSimulationRun
public static void EndSimulationRun() -
EndSimulationRunAt
public static void EndSimulationRunAt(double tick) -
PauseSimulationRun
public static void PauseSimulationRun() -
PauseSimulationRunAt
public static void PauseSimulationRunAt(double tick) -
DeleteExternalFile
-
WriteExternalFile
-
ReadExternalFile
-
GetParameter
Gets the named parameter's value.- Parameters:
name- the name of the parameter- Returns:
- the named parameter's value
-
RandomDrawAgainstThreshold
-
RandomDrawAgainstThreshold
public static boolean RandomDrawAgainstThreshold(double threshold) -
RandomDraw
public static double RandomDraw() -
RandomDraw
public static double RandomDraw(double lowerBound, double upperBound) -
RandomDraw
-
ExecuteProgram
-
OrQuery
-
bigDecimalArrayToIntArray
-
bigDecimalArrayToDoubleArray
-