barsuift.simLife.process
Interface Synchronizer3D

All Superinterfaces:
Persistent<Synchronizer3DState>, Publisher, Subscriber, Synchronizer, TaskSynchronizer<SplitConditionalTask>

public interface Synchronizer3D
extends TaskSynchronizer<SplitConditionalTask>, Persistent<Synchronizer3DState>

The synchronizer3D allows to run a list of given SplitConditionalTask at a constant rate.

The synchronizer is able to manage a stepSize parameter, which is reflected to its synchronized SplitConditionalTask.


Field Summary
 
Fields inherited from interface barsuift.simLife.process.Synchronizer
CYCLE_LENGTH_3D_MS, CYCLE_LENGTH_CORE_MS
 
Method Summary
 int getStepSize()
          Returns the step size of the 3D synchronizer.
 void schedule(SplitConditionalTask task)
          Adds the given task to the list of synchronized tasks.
 void setBarrier(java.util.concurrent.CyclicBarrier barrier)
          Set the barrier to use for synchronization purpose.
 void setStepSize(int stepSize)
          Sets the step size of the current 3D synchronizer.
 void unschedule(SplitConditionalTask task)
          Remove the given task from the list of synchronized tasks.
 
Methods inherited from interface barsuift.simLife.process.Synchronizer
isRunning, start, stop
 
Methods inherited from interface barsuift.simLife.message.Publisher
addSubscriber, clearChanged, countSubscribers, deleteSubscriber, deleteSubscribers, hasChanged, notifySubscribers, notifySubscribers, setChanged
 
Methods inherited from interface barsuift.simLife.message.Subscriber
update
 
Methods inherited from interface barsuift.simLife.Persistent
getState, synchronize
 

Method Detail

setStepSize

void setStepSize(int stepSize)
Sets the step size of the current 3D synchronizer.

Parameters:
stepSize - the step size

getStepSize

int getStepSize()
Returns the step size of the 3D synchronizer.

Returns:
the step size of the synchronizer

schedule

void schedule(SplitConditionalTask task)
Adds the given task to the list of synchronized tasks.

Specified by:
schedule in interface TaskSynchronizer<SplitConditionalTask>
Parameters:
task - the task to synchronize

unschedule

void unschedule(SplitConditionalTask task)
Remove the given task from the list of synchronized tasks.

Specified by:
unschedule in interface TaskSynchronizer<SplitConditionalTask>
Parameters:
task - the task to desynchronize

setBarrier

void setBarrier(java.util.concurrent.CyclicBarrier barrier)
Set the barrier to use for synchronization purpose.

Parameters:
barrier - the cyclic barrier used to synchronize the synchronizer with other synchronizers
Throws:
java.lang.IllegalArgumentException - if the given barrier is null
java.lang.IllegalStateException - if a barrier has already been set


Copyright © 2010. All Rights Reserved.