All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class oplan.acp3.ProcessModel

java.lang.Object
   |
   +----oplan.acp3.ProcessModel

public class ProcessModel
extends Object
implements WatcherListener, StatusValues
A ProcessModel contains a model of a process and handles the propagation of state changes. There are a number of interior classes so that the whole thing can be contained in one file and can avoid name conflicts with other parts of ACP3 (e.g. for class names such as "Node").

A ProcessModel receives information from a Watcher and is therefore an implementation of WatcherListener. It sends information to an implementation of ProcessViewer.

Before you can do anything very interesting, you have to install a viewer and read in a process definition. For example:

    ProcessModel model = new ProcessModel();
    model.setViewer(someViewer);
    model.initFromFile("ProcessModels/acp3-process.lsp");
 

See Also:
WatcherListener, ProcessViewer

Variable Index

 o allNodes
 o changedNodes
 o nodeTable
 o numberOfCoas
 o overallColumn
 o rowTable
 o schemaTable
 o viewer

Constructor Index

 o ProcessModel()
Create an empty ProcessModel.

Method Index

 o addCoa(int)
Add the actions for a new COA to the model.
 o addRowElement(ProcessModel. Node)
 o checkConnectivity()
Checks that we can reach all of the nodes in various ways.
 o depthFirstFinishOrder(List, Function1)
 o dffoWalk_(Object, Function1, Hashtable, ListCollector)
 o ensureOverallCell(String)
 o finalNodes()
 o finalNodes(Enumeration, int)
 o findActionNode(String, int)
 o findNode(List)
 o findOverallCell(String)
 o finishAction(String, int)
Called by a watcher when it detects that an action has finished.
 o finishAction(String, int, int)
Called by a watcher when it detects that an action has finished.
 o fullStateDescription()
 o initFromFile(String)
Read action definitions from a file.
 o initialNodes()
 o initialNodes(Enumeration, int)
 o issueCounts()
 o newOverallCellInstance(String)
Create an instance of an appropriate OverallCell class.
 o nodesAfter(ProcessModel. Node)
 o nodesBefore(ProcessModel. Node)
 o nodesBetween(ProcessModel. Node, ProcessModel. Node)
 o nodesInDepthFirstFinishOrder()
 o registerNode(ProcessModel. Node)
 o reset()
Remove all COAs, their associated actions, and all current state information.
 o resetChangeRecord()
 o seeIfNewCoa(int)
 o sendFullStateDescription()
Send the viewer a complete state description, rather than a delta.
 o setViewer(ProcessViewer)
Install a viewer that will be sent status information when changes occur.
 o startAction(String, int)
Called by a watcher when it detects that an action has started.
 o startAction(String, int, int)
Called by a watcher when it detects that an action has started.
 o startRecordingChanges()
 o statusChanges()
 o tellViewer()
 o topLevelNodes()

Variables

 o viewer
 ProcessViewer viewer
 o schemaTable
 ProcessModel. SchemaTable schemaTable
 o nodeTable
 ProcessModel. NodeTable nodeTable
 o allNodes
 Vector allNodes
 o rowTable
 Hashtable rowTable
 o overallColumn
 Hashtable overallColumn
 o numberOfCoas
 int numberOfCoas
 o changedNodes
 HashSet changedNodes

Constructors

 o ProcessModel
 public ProcessModel()
Create an empty ProcessModel.

Methods

 o setViewer
 public synchronized void setViewer(ProcessViewer viewer)
Install a viewer that will be sent status information when changes occur.

 o initFromFile
 public synchronized void initFromFile(String filename)
Read action definitions from a file. Each action definition (or schema) specifies the subactions (if any), a partial order over the subactions, and any special properties of the action that affect how it is modelled. This information is used when building data structures that represent the actions that are present in the process being modelled.

 o reset
 public synchronized void reset()
Remove all COAs, their associated actions, and all current state information. However, the definitions established by the most recent call to initFromFile remain; it is not necessary to call it again after a reset.

 o addCoa
 public synchronized void addCoa(int coaNumber)
Add the actions for a new COA to the model. Note that the new COA's number must be exactly one greater than the current number of COAs. The only way to add a higher-numbered COA is to call addCoa more than once.

 o sendFullStateDescription
 public synchronized void sendFullStateDescription()
Send the viewer a complete state description, rather than a delta. This is normally a request from the viewer, for instance if it has been ignoring changes (for some reason) and wants to catch up.

 o fullStateDescription
 protected Vector fullStateDescription()
 o startAction
 public void startAction(String action,
                         int coa)
Called by a watcher when it detects that an action has started.

 o startAction
 public synchronized void startAction(String action,
                                      int coa,
                                      int level)
Called by a watcher when it detects that an action has started.

 o finishAction
 public void finishAction(String action,
                          int coa)
Called by a watcher when it detects that an action has finished.

 o finishAction
 public synchronized void finishAction(String action,
                                       int coa,
                                       int level)
Called by a watcher when it detects that an action has finished.

 o seeIfNewCoa
 protected void seeIfNewCoa(int coa)
 o startRecordingChanges
 protected void startRecordingChanges()
 o resetChangeRecord
 protected void resetChangeRecord()
 o tellViewer
 protected void tellViewer()
 o statusChanges
 protected Vector statusChanges()
 o issueCounts
 protected int[] issueCounts()
 o registerNode
 void registerNode(ProcessModel. Node node)
 o findNode
 protected ProcessModel. Node findNode(List pattern)
 o findActionNode
 public ProcessModel. Node findActionNode(String action,
                                          int coa)
 o addRowElement
 void addRowElement(ProcessModel. Node node)
 o ensureOverallCell
 ProcessModel. OverallCell ensureOverallCell(String action)
 o findOverallCell
 ProcessModel. OverallCell findOverallCell(String action)
 o topLevelNodes
 public List topLevelNodes()
 o initialNodes
 public List initialNodes()
 o initialNodes
 public List initialNodes(Enumeration ne,
                          int level)
 o finalNodes
 public List finalNodes()
 o finalNodes
 public List finalNodes(Enumeration ne,
                        int level)
 o nodesBefore
 public List nodesBefore(ProcessModel. Node after)
 o nodesAfter
 public List nodesAfter(ProcessModel. Node before)
 o nodesBetween
 public List nodesBetween(ProcessModel. Node before,
                          ProcessModel. Node after)
 o nodesInDepthFirstFinishOrder
 public List nodesInDepthFirstFinishOrder()
 o depthFirstFinishOrder
 public List depthFirstFinishOrder(List roots,
                                   Function1 successors)
 o dffoWalk_
 private void dffoWalk_(Object at,
                        Function1 sf,
                        Hashtable marks,
                        ListCollector result)
 o checkConnectivity
 public synchronized void checkConnectivity()
Checks that we can reach all of the nodes in various ways. This method is not called during the normal operation of the process model but can be called when testing.

 o newOverallCellInstance
 ProcessModel. OverallCell newOverallCellInstance(String action)
Create an instance of an appropriate OverallCell class.


All Packages  Class Hierarchy  This Package  Previous  Next  Index