de.grogra.rgg
Class ConcurrentTask

java.lang.Object
  extended by de.grogra.rgg.ConcurrentTask
All Implemented Interfaces:
PartialTask, java.io.Serializable, java.lang.Runnable

public abstract class ConcurrentTask
extends java.lang.Object
implements PartialTask, java.lang.Runnable, java.io.Serializable

This abstract class has to be used as base class for concurrent tasks in the context of an RGG. Such a task must not perform any immediate modification to the graph, however, it is allowed to add quasi-parallel actions to one of the queues of the current extent (see Graph.getQueues()). This includes XL rule application and quasi-parallel assignments to XL properties.

The task is implemented by the run method of the superinterface Runnable as in the following example:

     ConcurrentTask task = new ConcurrentTask ()
     {
         public void run ()
         [
             X ==> Y;
             a:A ::> a[value] :+= 1;
         ]
     };
 

A concurrent task is added to an instance of ConcurrentTasks, then the invocation of solve on this instance will execute all added concurrent tasks.

Author:
Ole Kniemeyer
See Also:
Serialized Form

Constructor Summary
ConcurrentTask()
           
 
Method Summary
 GraphState getGraphState()
           
 void markProcessed()
           
 void setGraphState(GraphState state)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.lang.Runnable
run
 

Constructor Detail

ConcurrentTask

public ConcurrentTask()
Method Detail

getGraphState

public GraphState getGraphState()

markProcessed

public void markProcessed()

setGraphState

public void setGraphState(GraphState state)