Package repast.simphony.essentials
Class RepastEssentials
java.lang.Object
repast.simphony.essentials.RepastEssentials
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Context
AddAgentToContext
(String parentContextPath, Object agent) static void
AddValueLayer
(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 IAction
CancelAction
(ISchedulableAction actionToCancel) static Network
Create1DLatticeNetwork
(String parentContextPath, String networkName, boolean directed, boolean toroidal, boolean symmetrical) static Network
Create2DLatticeNetwork
(String parentContextPath, String networkName, boolean directed, boolean toroidal) static Object
CreateAgent
(String parentContextPath, String newAgentType) static Object
CreateAgents
(String parentContextPath, String newAgentType, int agentCount) static Context
CreateContext
(String parentContextPath, String newContextName) static ContinuousSpace
CreateContinuousSpace
(String parentContextPath, String newProjectionName, String borders, int... dimensions) static ContinuousSpace
CreateContinuousSpace
(String parentContextPath, String newProjectionName, String borders, BigDecimal... dimensions) static ContinuousValueLayer
CreateContinuousValueLayer
(String contextPath, String name, double... dimensions) Creates a ContinousValueLayer and adds it to the specified context.static ContinuousValueLayer
CreateContinuousValueLayer
(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 Grid
CreateGrid
(String parentContextPath, String newProjectionName, String borders, int... dimensions) static Grid
CreateGrid
(String parentContextPath, String newProjectionName, String borders, BigDecimal... dimensions) static GridValueLayer
CreateGridValueLayer
(String contextPath, String name, int... dimensions) Creates a GridValueLayer and adds it to the specified context.static GridValueLayer
CreateGridValueLayer
(String contextPath, String name, BigDecimal... dimensions) static Network
CreateNetwork
(String parentContextPath, String netName, boolean isDirected) static Network
CreateNetwork
(String parentContextPath, String netName, boolean isDirected, String agentClassName, String fileName, NetworkFileFormat format) static Network
CreateNetwork
(String parentContextPath, String networkName, boolean directed, NetworkGenerator gen) static Projection
CreateProjection
(String parentContextPath, String newProjectionName, String newProjectionType) static Projection
CreateProjection
(String parentContextPath, String newProjectionName, String newProjectionType, boolean optionalProjectionKind) static Projection
CreateProjection
(String parentContextPath, String newProjectionName, String newProjectionType, boolean optionalProjectionKind, String optionalBorders, int... optionalDimensions) static Projection
CreateProjection
(String parentContextPath, String newProjectionName, String newProjectionType, int... optionalDimensions) static Projection
CreateProjection
(String parentContextPath, String newProjectionName, String newProjectionType, String optionalBorders, int... optionalDimensions) static Projection
CreateProjection
(String parentContextPath, String newProjectionName, String newProjectionType, String optionalBorders, BigDecimal... optionalDimensions) static Projection
CreateProjection
(String parentContextPath, String newProjectionName, String newProjectionType, BigDecimal... optionalDimensions) static Network
CreateRandomDensityNetwork
(String parentContextPath, String networkName, boolean directed, double density, boolean allowSelfLoops, boolean symmetric) static Network
CreateWattsBetaSmallWorldNetwork
(String parentContextPath, String networkName, boolean directed, double beta, int nghSize, boolean symmetrical) static Network
CreateWattsBetaSmallWorldNetwork
(String parentContextPath, String networkName, boolean directed, double beta, BigDecimal nghSize, boolean symmetrical) static boolean
DeleteExternalFile
(String fileName) static void
static void
EndSimulationRunAt
(double tick) static int
ExecuteProgram
(String directory, String commandLine) static List
FindAgentsInContext
(String contextPath, String sqlQuery) static List
FindAgentsInContext
(String contextPath, String sqlQuery, Object functionHandler) static List
FindAgentsInNetwork
(String contextPath, String sqlQuery) static List
FindAgentsInNetwork
(String networkPath, String sqlQuery, Object functionHandler) static Context
FindContext
(String contextPath) static ContinuousSpace
FindContinuousSpace
(String spacePath) Finds the Continuous Space projection from the given path.static RepastEdge
static Grid
Finds the Grid projection from the given path.static Network
FindNetwork
(String networkPath) Finds the Network projection from the given path.static Context
FindParentContext
(String contextPath) static Projection
FindProjection
(String projectionPath) static ValueLayer
FindValueLayer
(String valueLayerPath) Finds the ValueLayer that matches the specified path.static List
GetAdjacent
(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 double
GetEdgeWeight
(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 IndexedIterable
GetObjects
(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 Object
GetParameter
(String name) Gets the named parameter's value.static List
GetPredecessors
(String networkPath, Object agent) Gets the predecessors of the specified agent in the specified network.static Iterable
GetRandomObjects
(String contextPath, String className, long num) static List
GetSuccessors
(String networkPath, Object agent) Gets the successors of the specified agent in the specified network.static double
static javax.measure.Quantity<?>
static boolean
static void
MoveAgentByDisplacement
(String projectionPath, Object agent, Number... displacement) static void
MoveAgentByVector
(String projectionPath, Object agent, Number distance, Number... anglesInRadians) static Query
static void
static void
PauseSimulationRunAt
(double tick) static double
static double
RandomDraw
(double lowerBound, double upperBound) static double
RandomDraw
(BigDecimal lowerBound, BigDecimal upperBound) static boolean
RandomDrawAgainstThreshold
(double threshold) static boolean
RandomDrawAgainstThreshold
(BigDecimal threshold) static boolean
ReadExternalFile
(Object target, String xmlDataFileDescriptionFileName, String sourceFileName) static Context
RemoveAgentFromContext
(String parentContextPath, Object agent) static Context
RemoveAgentFromModel
(Object agent) static Context
RemoveContext
(String contextPath) static RepastEdge
RemoveEdge
(String networkProjectionPath, Object agentSource, Object agentTarget) static Projection
RemoveProjection
(String path) static ISchedulableAction
ScheduleAction
(Object agent, double optionalStartTime, double optionalRepeatInterval, String methodName, Object... parameters) static ISchedulableAction
ScheduleAction
(Object agent, double optionalStartTime, String methodName, Object... parameters) static ISchedulableAction
ScheduleAction
(Object agent, String methodName, Object... parameters) static RepastEdge
SetEdgeWeight
(String networkProjectionPath, Object agentSource, Object agentTarget, double newWeight) static boolean
WriteExternalFile
(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
-