org.jactr.tools.goalfeeder.injector
Interface IGoalInjector<T>

Type Parameters:
T -

public interface IGoalInjector<T>

code that is responsible for injecting a new goal into the running model. The injector will only be called during a safe period when the model is not running (as controlled by the gating timed events). Care should be taken that inserting of goals is sensitivity to pending events. For instance, the model may have fired a request to add a subgoal, but it won't be added for 50ms, during which time, this injector could be called. Before inserting the new goal, the TimedEventQueue should be checked for any pending goal modifications executed by IBufferBasedTimedEvent.
Those that are using the threaded cognition modules will want to make sure you are removing the correct goal manipulation event.

Author:
harrison

Method Summary
 GatingTimedEvent createGate(double currentTime, T experimentTask)
          GatingTimedEvents are necessary to control the flow of the model - i.e.
 IGoalResponder getResponder()
          return the goal responder necessary for handling responses
 boolean handles(T experimentTask)
          return true if we can transform a experimentTask into a goal
 org.jactr.core.chunk.IChunk injectGoal(T experimentTask, org.jactr.core.model.IModel model, GoalFeeder<T> feeder)
          if handles(Object) returns true, this will be called.
 

Method Detail

handles

boolean handles(T experimentTask)
return true if we can transform a experimentTask into a goal

Parameters:
component -
Returns:

injectGoal

org.jactr.core.chunk.IChunk injectGoal(T experimentTask,
                                       org.jactr.core.model.IModel model,
                                       GoalFeeder<T> feeder)
if handles(Object) returns true, this will be called. returning the inserted chunk. This is called on the model thread.

Parameters:
experimentTask -
model -
feeder -
Returns:

createGate

GatingTimedEvent createGate(double currentTime,
                            T experimentTask)
GatingTimedEvents are necessary to control the flow of the model - i.e. prevent it from running ahead of the goal feeder and vice/versa. If the experiment task runs for a fixed amount of time, you will want to return a gate that lasts that long.

Parameters:
currentTime -
experimentTask -
Returns:

getResponder

IGoalResponder getResponder()
return the goal responder necessary for handling responses

Returns: