de.upb.swt.epctools.simulator
Class EPCSimulator

java.lang.Object
  extended by de.upb.swt.epctools.simulator.EPCSimulator
All Implemented Interfaces:
ModelListener

public class EPCSimulator
extends java.lang.Object
implements ModelListener

This class contains interface functions for the simulation of an EPC and accesses the simulator functionality implemented in the EPC model.


Nested Class Summary
 class EPCSimulator.Information
           
private  class EPCSimulator.RefreshHighlightingComputationThread
           
private  class EPCSimulator.RefreshInformationComputationThread
           
 
Field Summary
private  int m_current_algorithm
           
private  EPC m_epc
           
private  EPC_DS m_exp_epc
           
private  boolean m_highlighting_up_to_date
           
private  EPCSimulator.Information m_information
           
private  boolean m_information_up_to_date
           
private  ModelListenerList m_listener
           
private  EPCSimulator.RefreshHighlightingComputationThread m_refresh_highlighting_computation_thread
           
private  EPCSimulator.RefreshInformationComputationThread m_refresh_information_computation_thread
           
private  EPC.MappingCopy m_simplified_epc
           
private  boolean m_simplified_epc_up_to_date
           
private  EPC_DS m_simplified_exp_epc
           
private  SimEPC m_simplified_sym_epc
           
private  boolean m_simulation_epc_up_to_date
           
private  SimEPC m_sym_epc
           
private  boolean m_use_optimistic_semantics
           
static int NO_THREAD_EXPLICIT_COMPUTATION_MAXIMUM
           
static int NO_THREAD_SYMBOLIC_COMPUTATION_MAXIMUM
           
static java.lang.String REFRESH_INFORMATION_DIALOG_TITLE
           
static int SIM_ALG_EXPLICIT
           
static int SIM_ALG_SYMBOLIC
           
 
Fields inherited from interface de.upb.swt.epctools.model.tools.ModelListener
MSG_ARC_ADDED, MSG_ARC_RECONNECTED, MSG_ARC_REMOVED, MSG_BEND_POINT_CHANGE, MSG_CHANGED_ALGORITHM, MSG_CONSTRAINT_CHANGED, MSG_DESCRIPTION_CHANGED, MSG_FOLDERS_CHANGED, MSG_HIGHLIGHTING_CHANGED, MSG_IN_ARC_ADDED, MSG_IN_ARC_REMOVED, MSG_INFO_CHANGED, MSG_LOCATION_CHANGED, MSG_NAME_CHANGED, MSG_NODE_ADDED, MSG_NODE_REMOVED, MSG_OUT_ARC_ADDED, MSG_OUT_ARC_REMOVED, MSG_SIZE_CHANGED, MSG_SOURCE_CHANGED, MSG_STRUCTURE_CHANGED, MSG_TARGET_CHANGED
 
Constructor Summary
EPCSimulator(EPC orig_epc)
          Initialization
 
Method Summary
 void addListener(ModelListener obj)
          ...
 void allowMultipleFolders(boolean flag)
          Set...
 boolean allowsMultipleFolders()
          Returns ture if Arcs can hold multiple folders, else it returns false meaning that Arcs can hold at most one folder.
private  void computeSimplifiedEPC()
           
(package private)  void createSimulationEPC(EPC epc)
           
 void forwardMessage(int message)
          Forwards a message to all listener objects.
 int getCurrentAlgorithm()
           
 EPCSimulator.Information getInformation()
          Returns some information.
 void getMessage(int msg_id)
          This function is called upon changes on the model object.
 boolean isHighlightingUpToDate()
          Returns whether the highlighting of enabled Nodes is up to date.
 java.lang.String printDebugInformation()
          Prints some information about the algorithm state.
 void refreshHighlighting()
          This function computes all Nodes of the EPC which are enabled and highlight them.
private  void refreshHighlightingWithoutInteraction()
           
 void refreshInformation()
          This functions updates the EPC semantics info box.
private  void refreshInformationWithoutInteraction()
           
 void removeListener(ModelListener obj)
          ...
 void setCurrentAlgorithm(int algorithm_id)
           
private  boolean trySimplifiedHighlightingComputation()
          Returns true iff the computation was successful.
 void useOptimisticSemantics(boolean use_optimistic_semantics)
          This function sets a flag so that the optimistic semantics relation is preferred or not.
 boolean usesOptimisticSemantics()
          Returns true if the optimistic semantics relation is preferred.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_epc

private EPC m_epc

m_sym_epc

private SimEPC m_sym_epc

m_exp_epc

private EPC_DS m_exp_epc

m_current_algorithm

private int m_current_algorithm

m_refresh_information_computation_thread

private EPCSimulator.RefreshInformationComputationThread m_refresh_information_computation_thread

m_refresh_highlighting_computation_thread

private EPCSimulator.RefreshHighlightingComputationThread m_refresh_highlighting_computation_thread

m_simplified_epc

private EPC.MappingCopy m_simplified_epc

m_simplified_sym_epc

private SimEPC m_simplified_sym_epc

m_simplified_exp_epc

private EPC_DS m_simplified_exp_epc

m_listener

private ModelListenerList m_listener

m_information

private EPCSimulator.Information m_information

m_highlighting_up_to_date

private boolean m_highlighting_up_to_date

m_information_up_to_date

private boolean m_information_up_to_date

m_simplified_epc_up_to_date

private boolean m_simplified_epc_up_to_date

m_simulation_epc_up_to_date

private boolean m_simulation_epc_up_to_date

m_use_optimistic_semantics

private boolean m_use_optimistic_semantics

REFRESH_INFORMATION_DIALOG_TITLE

public static final java.lang.String REFRESH_INFORMATION_DIALOG_TITLE
See Also:
Constant Field Values

NO_THREAD_SYMBOLIC_COMPUTATION_MAXIMUM

public static final int NO_THREAD_SYMBOLIC_COMPUTATION_MAXIMUM
See Also:
Constant Field Values

NO_THREAD_EXPLICIT_COMPUTATION_MAXIMUM

public static final int NO_THREAD_EXPLICIT_COMPUTATION_MAXIMUM
See Also:
Constant Field Values

SIM_ALG_SYMBOLIC

public static final int SIM_ALG_SYMBOLIC
See Also:
Constant Field Values

SIM_ALG_EXPLICIT

public static final int SIM_ALG_EXPLICIT
See Also:
Constant Field Values
Constructor Detail

EPCSimulator

public EPCSimulator(EPC orig_epc)
Initialization

Method Detail

createSimulationEPC

void createSimulationEPC(EPC epc)

addListener

public void addListener(ModelListener obj)
...


removeListener

public void removeListener(ModelListener obj)
...


forwardMessage

public void forwardMessage(int message)
Forwards a message to all listener objects.


getMessage

public void getMessage(int msg_id)
This function is called upon changes on the model object. This function belongs to the ModelListener interface.

Specified by:
getMessage in interface ModelListener
Parameters:
msg_id - Message id

isHighlightingUpToDate

public boolean isHighlightingUpToDate()
Returns whether the highlighting of enabled Nodes is up to date.


useOptimisticSemantics

public void useOptimisticSemantics(boolean use_optimistic_semantics)
This function sets a flag so that the optimistic semantics relation is preferred or not.


usesOptimisticSemantics

public boolean usesOptimisticSemantics()
Returns true if the optimistic semantics relation is preferred.


allowsMultipleFolders

public boolean allowsMultipleFolders()
Returns ture if Arcs can hold multiple folders, else it returns false meaning that Arcs can hold at most one folder.


allowMultipleFolders

public void allowMultipleFolders(boolean flag)
Set...


refreshHighlighting

public void refreshHighlighting()
                         throws EPCComputationException
This function computes all Nodes of the EPC which are enabled and highlight them.

Throws:
EPCComputationException

refreshHighlightingWithoutInteraction

private void refreshHighlightingWithoutInteraction()
                                            throws EPCComputationException
Throws:
EPCComputationException

trySimplifiedHighlightingComputation

private boolean trySimplifiedHighlightingComputation()
                                              throws EPCComputationException
Returns true iff the computation was successful. This function computes the highlighting only for non local Nodes!

Throws:
EPCComputationException

getInformation

public EPCSimulator.Information getInformation()
Returns some information. The members in the class Information can have the following values: EPC.TRUE if true, EPC.FALSE if false or EPC.UNKNOWN if outdated/unknown.


refreshInformation

public void refreshInformation()
                        throws EPCComputationException
This functions updates the EPC semantics info box. It runs in a computation thread so the user can break the action.

Throws:
EPCComputationException

refreshInformationWithoutInteraction

private void refreshInformationWithoutInteraction()
                                           throws EPCComputationException
Throws:
EPCComputationException

computeSimplifiedEPC

private void computeSimplifiedEPC()

printDebugInformation

public java.lang.String printDebugInformation()
Prints some information about the algorithm state.


setCurrentAlgorithm

public void setCurrentAlgorithm(int algorithm_id)

getCurrentAlgorithm

public int getCurrentAlgorithm()