org.jactr.tools.goalfeeder.timedevents
Class GatingTimedEvent

java.lang.Object
  extended by org.jactr.core.queue.timedevents.AbstractTimedEvent
      extended by org.jactr.tools.goalfeeder.timedevents.GatingTimedEvent
All Implemented Interfaces:
org.jactr.core.queue.ITimedEvent

public class GatingTimedEvent
extends org.jactr.core.queue.timedevents.AbstractTimedEvent

Author:
harrison

Constructor Summary
GatingTimedEvent(double start, double end)
           
GatingTimedEvent(double start, double end, java.lang.Object creator)
           
GatingTimedEvent(double start, double end, java.lang.Object creator, java.lang.Runnable onBlock)
           
 
Method Summary
 void abort()
           
 void fire(double now)
           
 java.lang.Object getCreator()
           
 boolean isBlocked()
          is there currently a model blocked?
 boolean isExternalWaiting()
           
 void release()
          release the gate.
 java.lang.String toString()
           
 void waitForModel()
          wait until either release is called, or the model reaches fire.
 boolean willBlock()
          will a model reaching the fire method block?
 
Methods inherited from class org.jactr.core.queue.timedevents.AbstractTimedEvent
getEndTime, getStartTime, hasAborted, hasFired, setTimes
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GatingTimedEvent

public GatingTimedEvent(double start,
                        double end)

GatingTimedEvent

public GatingTimedEvent(double start,
                        double end,
                        java.lang.Object creator)

GatingTimedEvent

public GatingTimedEvent(double start,
                        double end,
                        java.lang.Object creator,
                        java.lang.Runnable onBlock)
Method Detail

getCreator

public java.lang.Object getCreator()

abort

public void abort()
Specified by:
abort in interface org.jactr.core.queue.ITimedEvent
Overrides:
abort in class org.jactr.core.queue.timedevents.AbstractTimedEvent

fire

public void fire(double now)
Specified by:
fire in interface org.jactr.core.queue.ITimedEvent
Overrides:
fire in class org.jactr.core.queue.timedevents.AbstractTimedEvent

waitForModel

public void waitForModel()
                  throws java.lang.InterruptedException
wait until either release is called, or the model reaches fire.

Throws:
java.lang.InterruptedException

isExternalWaiting

public boolean isExternalWaiting()

isBlocked

public boolean isBlocked()
is there currently a model blocked?

Returns:

willBlock

public boolean willBlock()
will a model reaching the fire method block?

Returns:

release

public void release()
release the gate. if the model is currently blocked, it will be signaled and permitted to run on. if it isnt blocked, when the model makes it to fire, it will pass over the blocking.


toString

public java.lang.String toString()
Overrides:
toString in class org.jactr.core.queue.timedevents.AbstractTimedEvent