public class BPSimulator extends Object implements ISimulationLimits
Constructor and Description |
---|
BPSimulator() |
BPSimulator(List<String> processFiles)
Constructor with process model to simulate
|
Modifier and Type | Method and Description |
---|---|
void |
checkInterrupted() |
Activity |
getActivity(int index)
Returns activity by numeric index
|
int |
getActivityCount() |
Activity |
getCatchActivity(int parentProcessIndex,
int subProcessIndex,
String eventCode)
Returns intermediate or error event catch activity
|
Clock |
getClock()
Returns clock (time manager) for the simulation
|
long |
getEndTime() |
IEventProcessor |
getEventProcessor()
Returns the EventProcessor being used
|
int |
getFirstProcessInstanceForStats()
First process instance to start calculating statistics from (included).
|
GatewayPathSelector |
getGatewayPathSelector()
Returns the gateway path selector for this simulation
|
int |
getIdForNewProcessInstance()
Returns unique, auto increment, id for new process and sub-process instances
|
int |
getLastProcessInstanceForStats()
Last process instance to calculate statistics from (excluded).
|
ComplexLogger |
getLogger()
Returns default logger container to where optional loggers can be adde.
|
Activity[] |
getMainProcessStartEvents()
Returns array of Activity instances representing a start events of the main
process
|
int |
getMaxAllowedArrivalPeriodLengthInSeconds()
Returns the maximum arrival period length in seconds.If 0 then unlimited
|
int |
getMaxAllowedCompletedElements()
Returns the maximum allowed elements to be processed in the simulation
|
int |
getMaxAllowedProcesses() |
int |
getMaxAllowedResourceInstances() |
int |
getMaxAllowedResources() |
int |
getMaxAllowedResourceTaskQueueSize()
Get the maximum allowed task queue size for resource
|
int |
getMaxSimulationCycleTimeInSeconds()
Gets the maximum allowed cycle time in simulation
|
long |
getNextSeq()
Returns the sequence number for a ProcessActivity
|
RandomGenerator |
getRandomGenerator() |
ResourceManager |
getResourceManager()
Returns the used resource manager component
|
Date |
getSimulationStartTime()
Gets the simulation start time
|
long |
getStartTime() |
SimulationStatus |
getStatus()
Returns status of the simulation
|
Activity[] |
getSubProcessStartEvents(Integer subProcessIndex)
Returns array of Activity instances representing a start events of a
sub-process
|
TokenFlow |
getTokenFlow(int index)
Returns TokenFlow associated with numeric flow index.
|
int |
getTotalProcessedEvents() |
int |
getTotalProcessInstances()
Returns total number of process instances that the simulator created
|
void |
interrupt() |
void |
run()
Starts simulation
|
void |
setInputStreams(List<InputStream> inputStreams)
Sets the input streams of BPMN definitions to parse and simulate
|
void |
setMaxAllowedArrivalPeriodLengthInSeconds(int maxAllowedArrivalPeriodLengthInSeconds)
Sets the maximum period length for arrival period.
|
void |
setMaxAllowedArrivalPeriodLengthInSeoonds(int maxAllowedArrivalPeriodLengthInSeconds)
Deprecated.
use setMaxAllowedArrivalPeriodLengthInSeconds()
|
void |
setMaxAllowedCompletedElements(int maxAllowedCompletedElements)
Sets the maximum allowed elements to be processed in the simulation, 0 to
disable
|
void |
setMaxAllowedProcesses(int maxAllowedProcesses) |
void |
setMaxAllowedResourceInstances(int maxAllowedResourceInstances) |
void |
setMaxAllowedResources(int maxAllowedResources) |
void |
setMaxAllowedResourceTaskQueueSize(int maxAllowedResourceTaskQueueSize)
Set the maximum allowed task queue size for resource
|
void |
setMaxSimulationCycleTimeInSeconds(int maxSimulationCycleTimeInSeconds)
Set the maximum allowed simulation cycle time
|
public void setInputStreams(List<InputStream> inputStreams)
inputStreams
- input streams of BPMN definitions to simulatepublic void run() throws ModelParseException, BPSimulatorException, InterruptedException
public ComplexLogger getLogger()
public TokenFlow getTokenFlow(int index)
index
- index of the flowpublic Activity getActivity(int index)
index
- index of activitypublic Activity[] getSubProcessStartEvents(Integer subProcessIndex)
subProcessIndex
- index of the sub-processpublic Activity[] getMainProcessStartEvents() throws BPSimulatorException
BPSimulatorException
public Activity getCatchActivity(int parentProcessIndex, int subProcessIndex, String eventCode)
parentProcessIndex
- -1 for main process, index of process from where to
search the event handlersubProcessIndex
- Sub-process index that threw an eventeventCode
- Event code to handlepublic Clock getClock()
public SimulationStatus getStatus()
public int getTotalProcessInstances()
public ResourceManager getResourceManager()
public IEventProcessor getEventProcessor()
public GatewayPathSelector getGatewayPathSelector()
public long getNextSeq()
public int getIdForNewProcessInstance()
public long getStartTime()
public long getEndTime()
public int getTotalProcessedEvents()
public void checkInterrupted() throws InterruptedException
InterruptedException
public void interrupt()
public RandomGenerator getRandomGenerator()
public int getMaxAllowedCompletedElements()
getMaxAllowedCompletedElements
in interface ISimulationLimits
public void setMaxAllowedCompletedElements(int maxAllowedCompletedElements)
setMaxAllowedCompletedElements
in interface ISimulationLimits
maxAllowedCompletedElements
- maximum allowed elements to be processed
in the simulation to setpublic int getMaxAllowedArrivalPeriodLengthInSeconds()
getMaxAllowedArrivalPeriodLengthInSeconds
in interface ISimulationLimits
public void setMaxAllowedArrivalPeriodLengthInSeconds(int maxAllowedArrivalPeriodLengthInSeconds)
setMaxAllowedArrivalPeriodLengthInSeconds
in interface ISimulationLimits
maxAllowedArrivalPeriodLengthInSeconds
- the
maxAllowedArrivalPeriodLengthInSeconds
to setpublic void setMaxAllowedArrivalPeriodLengthInSeoonds(int maxAllowedArrivalPeriodLengthInSeconds)
public int getMaxAllowedResources()
getMaxAllowedResources
in interface ISimulationLimits
public void setMaxAllowedResources(int maxAllowedResources)
setMaxAllowedResources
in interface ISimulationLimits
maxAllowedResources
- total number of different resource types allowed
in simulationpublic int getMaxAllowedResourceInstances()
getMaxAllowedResourceInstances
in interface ISimulationLimits
public void setMaxAllowedResourceInstances(int maxAllowedResourceInstances)
setMaxAllowedResourceInstances
in interface ISimulationLimits
maxAllowedResourceInstances
- the number of resource instances that are
allowedpublic int getMaxAllowedProcesses()
getMaxAllowedProcesses
in interface ISimulationLimits
public void setMaxAllowedProcesses(int maxAllowedProcesses)
setMaxAllowedProcesses
in interface ISimulationLimits
maxAllowedProcesses
- maximum number of process instancespublic int getActivityCount()
public int getMaxSimulationCycleTimeInSeconds()
getMaxSimulationCycleTimeInSeconds
in interface ISimulationLimits
public void setMaxSimulationCycleTimeInSeconds(int maxSimulationCycleTimeInSeconds)
setMaxSimulationCycleTimeInSeconds
in interface ISimulationLimits
maxSimulationCycleTimeInSeconds
- maximum allowed cycle time in secondspublic int getMaxAllowedResourceTaskQueueSize()
getMaxAllowedResourceTaskQueueSize
in interface ISimulationLimits
public void setMaxAllowedResourceTaskQueueSize(int maxAllowedResourceTaskQueueSize)
setMaxAllowedResourceTaskQueueSize
in interface ISimulationLimits
maxAllowedResourceTaskQueueSize
- public Date getSimulationStartTime()
public int getFirstProcessInstanceForStats()
public int getLastProcessInstanceForStats()
Copyright © 2020 Pivotal Software, Inc.. All rights reserved.