org.simulator.sbml
Class EventInProcess

java.lang.Object
  extended by org.simulator.sbml.EventInProcess
Direct Known Subclasses:
EventInProcessWithDelay

public class EventInProcess
extends java.lang.Object

This class represents a compilation of all information calculated during simulation concerning events. It can also contain the math of the trigger, the priority and the delay.

Since:
0.9
Version:
$Rev: 147 $
Author:
Alexander Dörr

Field Summary
protected  java.util.Map<java.lang.Integer,java.lang.Double> assignments
           
protected  ASTNodeObject delayObject
           
protected  java.util.LinkedList<java.lang.Double> execTimes
           
protected  boolean fired
           
protected  double lastTimeExecuted
           
protected  double lastTimeFired
           
protected  double lastTimeRecovered
           
protected  boolean persistent
           
protected  double priority
           
protected  ASTNodeObject priorityObject
           
protected  java.util.List<AssignmentRuleObject> ruleObjects
           
protected  ASTNodeObject triggerObject
           
protected  boolean useValuesFromTriggerTime
           
protected  java.util.LinkedList<java.lang.Double[]> values
           
 
Constructor Summary
EventInProcess(boolean fired)
          Creates a new EventInProcess with the given boolean value indicating whether or not it can fire at time point 0d.
 
Method Summary
 void aborted(double time)
          The event has been aborted between trigger and execution.
 void addAssignment(int index, double value)
          Adds an event assignment.
 void addRuleObject(AssignmentRuleObject assignmentRuleObject)
          Adds the math of an assignment rule as an AssignmentRuleObject.
 void addValues(java.lang.Double[] values, double time)
          The event associated with this class has been triggered.
 void changePriority(double priority)
          Change the priority.
 void clearAssignments()
          Clears all event assignments.
 void clearRuleObjects()
          Clears the assignment rule objects.
 void executed(double time)
          The event associated with this class has been executed therefore reset some values.
 void fired(double time)
          Associated event has triggered therefore current value of fired to true
 java.util.Map<java.lang.Integer,java.lang.Double> getAssignments()
          Returns all event assignments as a map.
 ASTNodeObject getDelayObject()
           
 boolean getFireStatus(double time)
          Returns a boolean value indication if the associated event has recently been triggered / fired
 double getLastTimeExecuted()
          Returns the last time the event has been executed.
 double getLastTimeFired()
          Returns the last time the event has been fired.
 int getNumEventAssignments()
           
 boolean getPersistent()
           
 java.lang.Double getPriority()
          Return the priority of the associated event.
 ASTNodeObject getPriorityObject()
           
 java.util.List<AssignmentRuleObject> getRuleObjects()
           
 double getTime()
          Return the next time of execution of the associated event.
 ASTNodeObject getTriggerObject()
           
 boolean getUseValuesFromTriggerTime()
          Returns true if the values of the assignments are calculated at the trigger time of the event, otherwise false.
 java.lang.Double[] getValues()
          Return the values used in the next execution of the associated event.
 boolean hasExecutionTime()
          Returns true if the event is supposed to be executed at some time.
 boolean hasMoreAssignments(double time)
          Checks if this event has still assignments to perform for the given point in time
 void recovered(double time)
          The trigger of the associated event has made a transition from true to false, so the event can be triggered again.
 void refresh(boolean fired)
           
 void refresh(double currentTime)
          Refreshes the status of the event regarding the current time.
 void setDelayObject(ASTNodeObject delayObject)
          Sets the math of the delay to a specific ASTNodeObject.
 void setPersistent(boolean persistent)
          Sets the persistent flag of the event.
 void setPriorityObject(ASTNodeObject priorityObject)
          Sets the math of the priority to a specific ASTNodeObject.
 void setTriggerObject(ASTNodeObject triggerObject)
          Sets the math of the trigger to a specific ASTNodeObject.
 void setUseValuesFromTriggerTime(boolean useValuesFromTriggerTime)
          Sets the useValuesFromTriggerTime value of the event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fired

protected boolean fired

priority

protected double priority

lastTimeFired

protected double lastTimeFired

lastTimeRecovered

protected double lastTimeRecovered

lastTimeExecuted

protected double lastTimeExecuted

execTimes

protected java.util.LinkedList<java.lang.Double> execTimes

values

protected java.util.LinkedList<java.lang.Double[]> values

assignments

protected java.util.Map<java.lang.Integer,java.lang.Double> assignments

triggerObject

protected ASTNodeObject triggerObject

priorityObject

protected ASTNodeObject priorityObject

delayObject

protected ASTNodeObject delayObject

ruleObjects

protected java.util.List<AssignmentRuleObject> ruleObjects

useValuesFromTriggerTime

protected boolean useValuesFromTriggerTime

persistent

protected boolean persistent
Constructor Detail

EventInProcess

EventInProcess(boolean fired)
Creates a new EventInProcess with the given boolean value indicating whether or not it can fire at time point 0d.

Parameters:
fired -
Method Detail

refresh

public void refresh(boolean fired)
Parameters:
fired -

aborted

public void aborted(double time)
The event has been aborted between trigger and execution. For this class it has the same effect as the event has been executed.


addValues

public void addValues(java.lang.Double[] values,
                      double time)
The event associated with this class has been triggered. Therefore set the time of execution and the values used at this point in time. Please note that values can be null when the event does not use values from trigger time.

Parameters:
values -
time -

changePriority

public void changePriority(double priority)
Change the priority.

Parameters:
priority -

executed

public void executed(double time)
The event associated with this class has been executed therefore reset some values.


fired

public void fired(double time)
Associated event has triggered therefore current value of fired to true


getFireStatus

public boolean getFireStatus(double time)
Returns a boolean value indication if the associated event has recently been triggered / fired

Returns:

getPriority

public java.lang.Double getPriority()
Return the priority of the associated event.

Returns:

getTime

public double getTime()
Return the next time of execution of the associated event.

Returns:

hasExecutionTime

public boolean hasExecutionTime()
Returns true if the event is supposed to be executed at some time.

Returns:

getValues

public java.lang.Double[] getValues()
Return the values used in the next execution of the associated event.

Returns:

recovered

public void recovered(double time)
The trigger of the associated event has made a transition from true to false, so the event can be triggered again.


hasMoreAssignments

public boolean hasMoreAssignments(double time)
Checks if this event has still assignments to perform for the given point in time

Parameters:
time -
Returns:

getLastTimeFired

public double getLastTimeFired()
Returns the last time the event has been fired.

Returns:

getLastTimeExecuted

public double getLastTimeExecuted()
Returns the last time the event has been executed.

Returns:

refresh

public void refresh(double currentTime)
Refreshes the status of the event regarding the current time.

Parameters:
currentTime -

clearAssignments

public void clearAssignments()
Clears all event assignments.


addAssignment

public void addAssignment(int index,
                          double value)
Adds an event assignment.

Parameters:
index -
value -

getAssignments

public java.util.Map<java.lang.Integer,java.lang.Double> getAssignments()
Returns all event assignments as a map.

Returns:

setTriggerObject

public void setTriggerObject(ASTNodeObject triggerObject)
Sets the math of the trigger to a specific ASTNodeObject.

Parameters:
userObject -

getTriggerObject

public ASTNodeObject getTriggerObject()
Returns:
the trigger object of the event as an ASTNodeObject

setPriorityObject

public void setPriorityObject(ASTNodeObject priorityObject)
Sets the math of the priority to a specific ASTNodeObject.

Parameters:
userObject -

getPriorityObject

public ASTNodeObject getPriorityObject()
Returns:
the priority object of the event as an ASTNodeObject

setDelayObject

public void setDelayObject(ASTNodeObject delayObject)
Sets the math of the delay to a specific ASTNodeObject.

Parameters:
userObject -

getDelayObject

public ASTNodeObject getDelayObject()
Returns:
the delay object of the event as an ASTNodeObject (null if there is no delay)

addRuleObject

public void addRuleObject(AssignmentRuleObject assignmentRuleObject)
Adds the math of an assignment rule as an AssignmentRuleObject.

Parameters:
assignmentRuleObject -

getRuleObjects

public java.util.List<AssignmentRuleObject> getRuleObjects()
Returns:
the list of the assignment rules as AssignmentRuleObjects

getUseValuesFromTriggerTime

public boolean getUseValuesFromTriggerTime()
Returns true if the values of the assignments are calculated at the trigger time of the event, otherwise false.

Returns:

setUseValuesFromTriggerTime

public void setUseValuesFromTriggerTime(boolean useValuesFromTriggerTime)
Sets the useValuesFromTriggerTime value of the event.

Parameters:
useValuesFromTriggerTime -

getNumEventAssignments

public int getNumEventAssignments()
Returns:
the number of assignments of the event

getPersistent

public boolean getPersistent()
Returns:
the persistent flag of the event.

setPersistent

public void setPersistent(boolean persistent)
Sets the persistent flag of the event.

Parameters:
persistent -

clearRuleObjects

public void clearRuleObjects()
Clears the assignment rule objects.