public interface ISimulator
extends java.io.Serializable
Modifier and Type | Method and Description |
---|---|
boolean |
alternateStep()
Makes one alternate step of the last one.
|
void |
cleanPreviousConfigurations()
Cleans the configurations previously reached
|
int |
countAlternatives()
Counts the alternative steps which could be taken
|
Configuration |
getCurrentConfig()
Gets the current configuration
|
java.io.PrintStream |
getInfoChannel() |
Psystem |
getPsystem()
Returns the P-system simulated
|
double |
getTime()
Gets the elapsed time since the beginning of the simulation
|
int |
getVerbosity()
Gets the verbosity level which the instances take into account when reporting messages.
|
boolean |
isFinished()
Returns if the simulator has finished
|
boolean |
isTimed()
Gets if the elapsed time is being measured
|
void |
reset()
Resets the simulator to the initial configuration
|
void |
run()
Runs the simulator until reaching a halting configuration
|
void |
runSteps(int steps)
Takes a specified number of steps
|
void |
runUntilTimeOut(long timeOut)
Runs the simulator until the time out has been reached
|
void |
runUntilTimeOutorSteps(long timeOut,
int steps)
Runs the simulator until whether the time out or the steps have been
reached
|
void |
setCurrentConfig(Configuration configuration)
Sets the current configuration of the simulator
|
void |
setInfoChannel(java.io.PrintStream infoChannel)
Sets the simulator info channel
|
void |
setPsystem(Psystem psystem)
Sets the simulator P-system
|
void |
setTimed(boolean time)
Sets if the elapsed time is being measured or not
|
void |
setVerbosity(int verbosity)
Sets the verbosity level which the instances take into account when reporting messages.
|
boolean |
step()
Takes one step of simulation and generate a new configuration
|
boolean |
stepBack()
Takes one step back
|
boolean |
stepsBackAvailable()
Returns a boolean representing if there are any step back which the simulator can go back to
|
void |
stopThread()
Stops the current thread where the run process takes place
|
boolean |
supportsAlternateSteps()
Reports if the simulator supports alternate steps
|
boolean |
supportsStepBack()
Reports if the simulator supports step back
|
void setPsystem(Psystem psystem)
psystem
- the simulator p-systemjava.io.PrintStream getInfoChannel()
void runUntilTimeOutorSteps(long timeOut, int steps)
timeOut
- the maximum time out allowedsteps
- the maximum steps allowedPsystem getPsystem()
void setInfoChannel(java.io.PrintStream infoChannel)
infoChannel
- the info channel to be setvoid runUntilTimeOut(long timeOut)
timeOut
- the time out set as the maximum time outvoid run() throws PlinguaCoreException
PlinguaCoreException
- if any exception occurred during the executionvoid runSteps(int steps) throws PlinguaCoreException
steps
- the steps to be takenPlinguaCoreException
- if any exception occurred during the executionboolean step() throws PlinguaCoreException
PlinguaCoreException
- if a semantic error occursboolean alternateStep() throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException
- if alternate steps are not supportedint countAlternatives() throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException
- if alternate steps are not supportedboolean stepBack() throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException
- if steps back are not supportedvoid reset()
boolean supportsStepBack()
boolean supportsAlternateSteps()
Configuration getCurrentConfig()
double getTime()
boolean isTimed()
void setTimed(boolean time)
time
- if the elapsed time is being measuredint getVerbosity()
void setVerbosity(int verbosity)
verbosity
- the verbosity level to set.boolean stepsBackAvailable()
void cleanPreviousConfigurations()
void setCurrentConfig(Configuration configuration)
configuration
- the configuration to be setvoid stopThread()
boolean isFinished()