modesteditor.core.stepsimulation
Class PaltNode

java.lang.Object
  extended by modesteditor.core.stepsimulation.SimulationNode
      extended by modesteditor.core.stepsimulation.AltNode
          extended by modesteditor.core.stepsimulation.PaltNode

public class PaltNode
extends AltNode

Class representing a palt statement.


Field Summary
 
Fields inherited from class modesteditor.core.stepsimulation.AltNode
activeChild
 
Fields inherited from class modesteditor.core.stepsimulation.SimulationNode
alphabet, children, column, guard, hidden, isActive, length, line, newLabel, parent
 
Constructor Summary
PaltNode(int line, int column, SimulationNode parent)
          Default constructor
 
Method Summary
 void addChild(SimulationNode child)
          Method adds a child to the list if it is an Alternative.
 void childIsFinished(SimulationNode child)
          Method activates the alternatives if the actionGuard has been taken or finishes the PaltNode if an Alternative is done.
 java.util.List<ParTransition> collectParTransitions()
          If a child is active the ParTransitions from this child are collected.
 java.util.List<SimulationNode> collectTransitions()
          Method collects all children if not a child is already active
 java.util.ArrayList<org.eclipse.core.resources.IMarker> createSimHighlighting(org.eclipse.core.resources.IResource resource, org.eclipse.jface.text.IDocument document, boolean isPalt)
          Method that creates the markers that do the highlighting in the step simulation.
 void generateAlphabet()
          Method generates the alphabet from the actionGuard and all the alternatives.
 java.lang.String getName()
           
 java.util.ArrayList<PaltTransition> getPaltTransitions()
          Method for generating the list of PaltTransition of the node
 double getWeightSum()
           
 void notificationOfChildActivity(SimulationNode child)
          Method which is called from the child in order to notify the parent that it is active.
 java.lang.String printTransition()
          Method that prints the SimulationNode TODO better incoporation in Eclipse
 void releaseTransitions()
          Method shall release the active transitions of the node an it's children in case a do loop is broken or a STOP occured ...
 void setActive()
          Sets the node active and all children in the children list
 void takeTransition()
          No transition to be taken, only child can be consumed.
 
Methods inherited from class modesteditor.core.stepsimulation.AltNode
getParentList, isFinished
 
Methods inherited from class modesteditor.core.stepsimulation.SimulationNode
breakTransitionTaken, exceptionThrown, getAlphabet, getColumn, getGuard, getLength, getLine, getParent, hide, isActive, isHidden, relabelNode, setParent, stopCalled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PaltNode

public PaltNode(int line,
                int column,
                SimulationNode parent)
Default constructor

Parameters:
line -
column -
parent -
Method Detail

addChild

public void addChild(SimulationNode child)
Method adds a child to the list if it is an Alternative. If it is an ActionNode it is set a the actionGuard of the statement.

Overrides:
addChild in class SimulationNode
Parameters:
child - to add

setActive

public void setActive()
Description copied from class: AltNode
Sets the node active and all children in the children list

Overrides:
setActive in class AltNode

generateAlphabet

public void generateAlphabet()
Method generates the alphabet from the actionGuard and all the alternatives.

Overrides:
generateAlphabet in class AltNode

collectTransitions

public java.util.List<SimulationNode> collectTransitions()
Description copied from class: AltNode
Method collects all children if not a child is already active

Overrides:
collectTransitions in class AltNode
Returns:
the list of transitions

collectParTransitions

public java.util.List<ParTransition> collectParTransitions()
If a child is active the ParTransitions from this child are collected. Otherwise a ParTransition is created from the actionguard and the probabilistic transitions are added to this ParTransition.

Overrides:
collectParTransitions in class AltNode
Returns:
the list of parallel transitions

releaseTransitions

public void releaseTransitions()
Description copied from class: SimulationNode
Method shall release the active transitions of the node an it's children in case a do loop is broken or a STOP occured ...

Overrides:
releaseTransitions in class AltNode

childIsFinished

public void childIsFinished(SimulationNode child)
Method activates the alternatives if the actionGuard has been taken or finishes the PaltNode if an Alternative is done.

Overrides:
childIsFinished in class AltNode
Parameters:
child - that is finished

printTransition

public java.lang.String printTransition()
Description copied from class: SimulationNode
Method that prints the SimulationNode TODO better incoporation in Eclipse

Overrides:
printTransition in class SimulationNode

getWeightSum

public double getWeightSum()
Returns:
the sum of all weights (needed to compute probabilities).

getPaltTransitions

public java.util.ArrayList<PaltTransition> getPaltTransitions()
Method for generating the list of PaltTransition of the node

Returns:
the list of PaltTransitions of the node

notificationOfChildActivity

public void notificationOfChildActivity(SimulationNode child)
Description copied from class: SimulationNode
Method which is called from the child in order to notify the parent that it is active.

Overrides:
notificationOfChildActivity in class AltNode

takeTransition

public void takeTransition()
Description copied from class: AltNode
No transition to be taken, only child can be consumed.

Overrides:
takeTransition in class AltNode

createSimHighlighting

public java.util.ArrayList<org.eclipse.core.resources.IMarker> createSimHighlighting(org.eclipse.core.resources.IResource resource,
                                                                                     org.eclipse.jface.text.IDocument document,
                                                                                     boolean isPalt)
Description copied from class: SimulationNode
Method that creates the markers that do the highlighting in the step simulation. First creates the markers for itself and then for the parent hierarchy.

Overrides:
createSimHighlighting in class SimulationNode
Parameters:
resource - where to add the markers
document - needed in order to calculate the offsets
Returns:
a list of markers so that those can be disposed of when not needed anymore

getName

public java.lang.String getName()
Overrides:
getName in class SimulationNode