|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--scorej.S
The primary class for ScoreJ. S contains all primary
methods for defining the behaviors of agents and objects. It also
includes the methods which control the environment in which the agents
and objects are instantiated within.
| Field Summary | |
static float |
version
ScoreJ version |
| Method Summary | |
static void |
addScenario(java.lang.Class newScenario)
Adds a scenario to a table of known scenarios. |
static void |
addScenario(java.lang.String name,
java.lang.Class newScenario)
Adds a scenario to a table of known scenarios and associates it with the specified name. |
static OmarClock |
createClock()
A utility method that creates and returns an instance of the default clock class. |
static OmarClock |
createClock(java.lang.Class clockClass)
A utility method that creates and returns an instance of the specified clock class. |
static SignalWaitQueue |
createSignalQueue(ID receiver,
ID sender,
java.lang.String[] subject,
java.lang.Object[] pattern,
SignalEvaluator func)
Creates a signal queue for signals matching the specified receiver, sender subject, pattern and signalEvaluator function. |
static SignalWaitQueue |
createSignalQueue(java.lang.Object[] pattern)
Create a signal wait Queue for a specific pattern |
static SignalWaitQueue |
createSignalQueue(SignalEvaluator func)
Creates a queue of signals for which the SignalEvaluator function evaluates to true. |
static SignalWaitQueue |
createSignalQueue(java.lang.String[] subject)
Create a signal wait Queue for a specific signal type |
static SignalWaitQueue |
createSignalQueue(java.lang.String[] subject,
SignalEvaluator func)
Creates a signal queue for signals matching the specified subject and SignalEvaluator function. |
static void |
failSelf()
Throws a ScoreException, causing method to fail. |
static void |
failSelf(java.lang.String msg)
Throws a ScoreException, causing method to fail. |
static void |
fork(Invocation invoke1)
Spawns a new thread and executes the invocation method in that thread. |
static OmarClock |
getClock()
Getter for the clock object registered at this node. |
static Scenario |
getCurrentScenario()
Gets the current scenario. |
static java.lang.String |
getCurrentScenarioName()
Gets the name of the current scenario. |
static java.lang.Class |
getDefaultClockClass()
Gets the default clock class. |
static ScoreID |
getID()
Returns the globally unique ID associated with this node. |
static java.lang.String |
getName()
Returns the simulator's name. |
static void |
getResource(Resource[] resources,
ScoreJThread owner,
int priority)
Grabs a set of resources. |
static void |
getResource(Resource resource,
ScoreJThread owner,
int priority)
Grabs a resource. |
static java.util.Vector |
getScenarioNames()
Gets the names of known scenarios. |
static java.util.Vector |
getScenarios()
Gets the Classes of all known scenarios. |
static void |
initializeCommProtocol(java.lang.Class protocol,
java.util.Properties props)
Initializes a specific commumication protocol. |
static boolean |
isResourceAvailable(Resource resource,
int priority)
Checks whether a resource is available. |
static Future |
join(Invocation[] invocations)
Join executes its method invocations in parallel in separate threads. |
static Future |
join(Invocation invoke1,
Invocation invoke2)
Join executes its method invocations in parallel in separate threads. |
static Future |
join(Invocation invoke1,
Invocation invoke2,
Invocation invoke3)
Join executes its method invocations in parallel in separate threads. |
static Future |
join(Invocation invoke1,
Invocation invoke2,
Invocation invoke3,
Invocation invoke4)
Join executes its method invocations in parallel in separate threads. |
static void |
nameAndStartThread(java.lang.Thread t,
java.lang.String name)
|
static void |
pauseCurrentScenario()
Pause running the current scenario. |
static Future |
race(Invocation[] invocations)
Race, like satisfy(Invocation[] invocations) expresses
alternative steps, only one of which needs to complete. |
static Future |
race(Invocation invoke1,
Invocation invoke2)
Race, like satisfy(Invocation invoke1,
Invocation invoke2) expresses alternative steps, only one of which
needs to complete successfully or fail for the race to finish. |
static Future |
race(Invocation invoke1,
Invocation invoke2,
Invocation invoke3)
Race, like satisfy(Invocation invoke1,
Invocation invoke2, Invocation invoke3) expresses
alternative steps, only one of which needs to complete successfully
or fail for the race to finish. |
static Future |
race(Invocation invoke1,
Invocation invoke2,
Invocation invoke3,
Invocation invoke4)
Race, like satisfy(Invocation invoke1,
Invocation invoke2, Invocation invoke3, Invocation invoke4) expresses
alternative steps, only one of which needs to complete successfully
or fail for the race to finish. |
static void |
releaseResource(Resource[] resources,
ScoreJThread owner)
Releases a set of previously acquired resources. |
static void |
releaseResource(Resource resource,
ScoreJThread owner)
Releases a previously acquired resource. |
static void |
resume(java.lang.Thread t)
Resumes a previosuly suspended thread. |
static void |
resumeCurrentScenario()
Resume running the current scenario, which must have been paused. |
static void |
runClock(boolean isDaemonThread)
Starts the clock in a separate thread. |
static Future |
satisfy(Invocation[] invocations)
Satisfy, like race(Invocation[] invocations) expresses
alternative steps, only one of which needs to complete. |
static Future |
satisfy(Invocation invoke1,
Invocation invoke2)
Satisfy, like race(Invocation invoke1,
Invocation invoke2) expresses
alternative steps, only one of which needs to complete successfully
for the satisfy to finish. |
static Future |
satisfy(Invocation invoke1,
Invocation invoke2,
Invocation invoke3)
Satisfy, like race(Invocation invoke1,
Invocation invoke2, Invocation invoke3) expresses
alternative steps, only one of which needs to complete successfully
for the satisfy to finish. |
static Future |
satisfy(Invocation invoke1,
Invocation invoke2,
Invocation invoke3,
Invocation invoke4)
Satisfy, like race(Invocation invoke1,
Invocation invoke2, Invocation invoke3, Invocation invoke4) expresses
alternative steps, only one of which needs to complete. |
static void |
sendSignalGlobal(ID sender,
java.lang.String[] subject,
java.lang.Object[] signalArgs)
Sends a signal with spcified sender, subject and signal arguments to all nodes eligible to receive it. |
static void |
sendSignalGlobal(java.lang.Object[] signalArgs)
Sends a signal with specified signal arguments to all nodes eligible to receive it. |
static void |
sendSignalGlobal(Signal signal)
Sends a signal to all nodes eligible to receive it. |
static void |
sendSignalGlobal(java.lang.String[] subject,
java.lang.Object[] signalArgs)
Sends a signal with subject and signal arguments to all nodes eligible to receive it. |
static void |
sendSignalGlobal(java.lang.String[] subject,
java.lang.String signalArg)
Sends a signal with specified sender, subject and signal name to all nodes eligible to receive it. |
static void |
sendSignalLocal(ID[] receivers,
ID sender,
java.lang.String[] subject,
java.lang.Object[] signalArgs)
Sends a signal within the local node. |
static void |
sendSignalLocal(ID receiver,
ID sender,
java.lang.String[] subject,
java.lang.Object[] signalArgs)
Sends a signal within the local node. |
static void |
sendSignalLocal(ID receiver,
java.lang.Object[] signalArgs)
Sends a signal with a null sender and null subject within the local node. |
static void |
sendSignalLocal(ID receiver,
java.lang.String[] subject,
java.lang.Object[] signalArgs)
Sends a signal with a null sender within the local node. |
static void |
sendSignalLocal(java.lang.Object[] signalArgs)
Sends a signal with a null sender, null subject and null receivers within the local node. |
static void |
sendSignalLocal(Signal signal)
Sends a signal within the local node. |
static void |
sendSignalLocal(java.lang.String signalArg)
Sends a signal with a null sender and null subject within the local node. |
static void |
sendSignalTo(ID[] receivers,
ID sender,
java.lang.String[] subject,
java.lang.Object[] signalArgs)
Sends a signal with the specified receivers, sender, subject and signal arguments to all nodes eligible to receive it. |
static void |
sendSignalTo(ID receiver,
ID sender,
java.lang.String[] subject,
java.lang.Object[] signalArgs)
Sends a signal with the specified receiver, sender, subject and signal arguments to all nodes eligible to receive it. |
static void |
sendSignalTo(ID receiver,
java.lang.Object[] signalArgs)
Sends a signal with the specified receiver and signal arguments to all nodes eligible to receive it. |
static void |
sendSignalTo(ID receiver,
java.lang.String[] subject,
java.lang.Object[] signalArgs)
Sends a signal with the specified receiver, subject and signal arguments to all nodes eligible to receive it. |
static void |
sendSignalTo(Signal signal)
Sends a signal with the receivers, sender, subject and signal arguments specified in the signal object to all nodes eligible to receive it. |
static void |
setClock(OmarClock newClock)
Setter for the clock object at this node. |
static void |
setCurrentScenario(Scenario scen)
Sets the current scenario. |
static void |
setCurrentScenario(java.lang.String scenName)
Sets the current scenario. |
static void |
setDefaultClockClass(java.lang.Class c)
Set the default clock class that will get created if you call Scenario.initialize with no clock parameter. |
static void |
setName(java.lang.String simulatorName)
Each node gets a default non-null simulator name on startup. |
static void |
shutdownCommProtocol(java.lang.Class protocol)
Call this method to close the communication mechanism that this node will use to communicate with other nodes and applications. |
static void |
sleep(double time)
Suspends execution of the method until the specified amount of time has passed. |
static void |
sleepUntil(double time)
Suspends execution of the method until a future time has been reached. |
static Future |
spawn(Invocation invoke1)
Spawns a new thread and executes the invocation method in that thread. |
static void |
startCommProtocol(java.lang.Class protocol)
Starts the communication mechanism that this node will use to communicate with other nodes and applications. |
static void |
startCurrentScenario()
Initialize and start the current Scenario using the default clock. |
static void |
startCurrentScenario(OmarClock clock,
boolean isClockDaemonThread)
Initialize and start the current Scenario using the specified clock. |
static void |
stopCurrentScenario()
Stop running the current scenario. |
static boolean |
suspend(java.lang.Thread t)
Suspends a thread. |
static void |
transferOwnershipAndStart(ScoreJThread currentOwner,
Resource[] resources,
ScoreJThread newOwner)
Atomically transfer the ownership of the set of resources to the specified thread and start the thread. |
static void |
transferOwnershipAndStart(ScoreJThread currentOwner,
Resource resource,
ScoreJThread newOwner)
Atomically transfer the ownership of the resource to the specified thread and start the thread. |
static Signal |
waitForQueuedSignal(SignalWaitQueue queue)
Wait for a signal that has a associated queue. |
static Signal |
waitForSignal(ID receiver,
ID sender,
java.lang.String[] subject,
java.lang.Object[] pattern,
SignalEvaluator func)
|
static Signal |
waitForSignal(java.lang.Object[] pattern)
Waits for a signal matching the specified pattern. |
static Signal |
waitForSignal(SignalEvaluator func)
Waits for a signal on which the SignalEvaluator function evaluates to true. |
static Signal |
waitForSignal(java.lang.String signalArg)
Waits for a signal with a given signal name. |
static Signal |
waitForSignal(java.lang.String[] subject)
Waits for a signal with a given signal name. |
static Signal |
waitForSignal(java.lang.String[] subject,
SignalEvaluator func)
Waits for a signal matching the signal name and where the SignalEvaluator function evaluates to true. |
static Signal |
waitForSignal(java.lang.String signalArg,
SignalEvaluator func)
Waits for a signal matching the signal name and where the SignalEvaluator function evaluates to true. |
static boolean |
wasSuspended(double startTime,
java.lang.Thread t)
Checks whether the thread was suspended after a given time. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final float version
| Method Detail |
public static void setDefaultClockClass(java.lang.Class c)
throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundExceptionpublic static java.lang.Class getDefaultClockClass()
public static final OmarClock createClock()
throws java.lang.NoSuchMethodException,
java.lang.InstantiationException,
java.lang.IllegalAccessException,
java.lang.reflect.InvocationTargetException
setClock(scorej.OmarClock) to achieve that effect.
java.lang.NoSuchMethodException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
public static final OmarClock createClock(java.lang.Class clockClass)
throws java.lang.NoSuchMethodException,
java.lang.InstantiationException,
java.lang.IllegalAccessException,
java.lang.reflect.InvocationTargetException
setClock(scorej.OmarClock) to achieve that effect.
java.lang.NoSuchMethodException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetExceptionpublic static final void runClock(boolean isDaemonThread)
isDaemonThread - when true, clock thread is set to be a daemon
thread. This has the effect of ending the clock thread when all
non-daemon threads, (such as the scenario thread) have ended. When
this parameter is set to false, the clok will continue running even
when the scenario has come to an end.public static final OmarClock getClock()
public static final void setClock(OmarClock newClock)
runClock(boolean) to
start the clock thread.
public static void initializeCommProtocol(java.lang.Class protocol,
java.util.Properties props)
protocol - a class that implements
CommProtocol.props - A Properties object that contains
initialization parameters for the protocol.
This argument can be null if the protocol does not require initialization
parameters or can initialize with a set of default initialization
parameters.
public static void startCommProtocol(java.lang.Class protocol)
throws java.lang.Exception
initializeCommProtocol(java.lang.Class, java.util.Properties) is called.
java.lang.Exceptionpublic static void shutdownCommProtocol(java.lang.Class protocol)
initializeCommProtocol(java.lang.Class, java.util.Properties) is called.
public static final ScoreID getID()
ID object representing this node.public static final java.lang.String getName()
setName(java.lang.String), otherwise one will be generated.
public static final void setName(java.lang.String simulatorName)
public static void nameAndStartThread(java.lang.Thread t,
java.lang.String name)
public static void sleep(double time)
time - - length of time to sleeppublic static void sleepUntil(double time)
time - - absolute time at which to wake up (relative to time step
zero in simulation time).public static boolean suspend(java.lang.Thread t)
t - thread to be suspended
public static void resume(java.lang.Thread t)
t - thread to be resumed.
public static boolean wasSuspended(double startTime,
java.lang.Thread t)
startTime - - time after which to check for a suspensiont - thread object.
public static Future join(Invocation invoke1,
Invocation invoke2)
Future object whose
Future.getValue() method returns an object array, but
only after all methods complete successfully. If any method fails,
Future.getValue() immediately throws an exception.
invoke1 - method Invocationinvoke2 - method Invocation
public static Future join(Invocation invoke1,
Invocation invoke2,
Invocation invoke3,
Invocation invoke4)
Future object whose
Future.getValue() method returns an object array, but
only after all methods complete successfully. If any method fails,
Future.getValue() immediately throws an exception.
invoke1 - method Invocationinvoke2 - method Invocationinvoke3 - method Invocationinvoke4 - method Invocation
public static Future join(Invocation invoke1,
Invocation invoke2,
Invocation invoke3)
Future object whose
Future.getValue() method returns an object array, but
only after all methods complete successfully. If any method fails,
Future.getValue() immediately throws an exception.
invoke1 - method Invocationinvoke2 - method Invocationinvoke3 - method Invocation
public static Future join(Invocation[] invocations)
Future object whose
Future.getValue() method returns an object array, but
only after all methods complete successfully. If any method fails,
Future.getValue() immediately throws an exception.
invocations - array of method invocations
public static Future race(Invocation invoke1,
Invocation invoke2)
satisfy(Invocation invoke1,
Invocation invoke2) expresses alternative steps, only one of which
needs to complete successfully or fail for the race to finish.
Race executes its method invocations in parallel by starting a
separate thread for each method invocation. It returns a
Future object whose Future.getValue()
method returns the return value of the first method to complete. If
any method fails prior to a method completing,
Future.getValue() immediately throws an
exception. After the first method completes, all other methods
are shut down.
invoke1 - method Invocationinvoke2 - method Invocation
public static Future race(Invocation invoke1,
Invocation invoke2,
Invocation invoke3)
satisfy(Invocation invoke1,
Invocation invoke2, Invocation invoke3) expresses
alternative steps, only one of which needs to complete successfully
or fail for the race to finish. Race executes its method invocations
in parallel by starting a separate thread for each
method invocation. It returns a Future
object whose Future.getValue() method returns the
return value of the first method to complete. If any method fails prior
to a method completing, Future.getValue() immediately
throws an exception. After the first method completes, all other methods
are shut down.
invoke1 - method Invocationinvoke2 - method Invocationinvoke3 - method Invocation
public static Future race(Invocation invoke1,
Invocation invoke2,
Invocation invoke3,
Invocation invoke4)
satisfy(Invocation invoke1,
Invocation invoke2, Invocation invoke3, Invocation invoke4) expresses
alternative steps, only one of which needs to complete successfully
or fail for the race to finish. Race executes its method invocations
in parallel by starting a separate thread for each
method invocation. It returns a Future
object whose Future.getValue() method returns the
return value of the first method to complete. If any method fails prior
to a method completing, Future.getValue() immediately
throws an exception. After the first method completes, all other methods
are shut down.
invoke1 - method Invocationinvoke2 - method Invocationinvoke3 - method Invocationinvoke4 - method Invocation
public static Future race(Invocation[] invocations)
satisfy(Invocation[] invocations) expresses
alternative steps, only one of which needs to complete. Race executes
its method invocations in parallel by starting a separate thread for each
method invocation. It returns a Future
object whose Future.getValue() method returns the
return value of the first method to complete. If any method fails prior
to a method completing, Future.getValue() immediately
throws an exception. After the first method completes, all other methods
are shut down.
invocations - array of method invocations
public static Future spawn(Invocation invoke1)
Future whose Future.getValue()
method will return the result of the invoked method.
Note: the calling thread is recorded with the simulation clock, if
the clock doesn't already know about it. This means that simulation time
will not advance until the calling thread enters a Scorej wait state (for
example, by calling getValue() on the returned Future). In practice, it
is best to use fork(scorej.Invocation) instead of spawn if you are not
going to retrieve the return value.
invoke1 - method Invocation
public static void fork(Invocation invoke1)
invoke1 - method Invocation
public static Future satisfy(Invocation invoke1,
Invocation invoke2)
race(Invocation invoke1,
Invocation invoke2) expresses
alternative steps, only one of which needs to complete successfully
for the satisfy to finish. Satisfy executes its method invocations in
parallel by starting a separate thread for each method invocation.
It returns a Future
object whose Future.getValue() method returns the
return value of the first method to successfully complete. If all methods
fail, Future.getValue() throws the exception from
the last failed method. After the first method completes, all other
methods are shut down.
invoke1 - method Invocationinvoke2 - method Invocation
public static Future satisfy(Invocation invoke1,
Invocation invoke2,
Invocation invoke3)
race(Invocation invoke1,
Invocation invoke2, Invocation invoke3) expresses
alternative steps, only one of which needs to complete successfully
for the satisfy to finish. Satisfy executes its method invocations in
parallel by starting a separate thread for each
method invocation. It returns a Future
object whose Future.getValue() method returns the
return value of the first method to successfully complete. If all
methods fail, Future.getValue() throws the exception from
the last failed method. After the first method completes, all other
methods are shut down.
invoke1 - method Invocationinvoke2 - method Invocationinvoke3 - method Invocation
public static Future satisfy(Invocation invoke1,
Invocation invoke2,
Invocation invoke3,
Invocation invoke4)
race(Invocation invoke1,
Invocation invoke2, Invocation invoke3, Invocation invoke4) expresses
alternative steps, only one of which needs to complete. Satisfy executes
its method invocations in parallel by starting a separate thread for each
method invocation. It returns a Future
object whose Future.getValue() method returns the
return value of the first method to successfully complete. If all methods
fail, Future.getValue() throws the exception from
the last failed method. After the first method completes, all other
methods are shut down.
invoke1 - method Invocationinvoke2 - method Invocationinvoke3 - method Invocationinvoke4 - method Invocation
public static Future satisfy(Invocation[] invocations)
race(Invocation[] invocations) expresses
alternative steps, only one of which needs to complete. Satisfy executes
its method invocations in parallel by starting a separate thread for each
method invocation. It returns a Future
object whose Future.getValue() method returns the
return value of the first method to successfully complete. If all methods
fail, Future.getValue() throws the exception from
the last failed method. After the first method completes, all other
methods are shut down.
invocations - array of method invocations
public static void sendSignalTo(ID receiver,
java.lang.Object[] signalArgs)
receiver - The receiver for whom the signal is intended. Should not
be null.signalArgs - The signal arguments. These should never be null or
empty.
public static void sendSignalTo(ID receiver,
java.lang.String[] subject,
java.lang.Object[] signalArgs)
receiver - The receiver for whom the signal is intended. Should not
be null.subject - A string array specifying the subject of the signal.signalArgs - The signal arguments. These should never be null or
empty.
public static void sendSignalTo(ID receiver,
ID sender,
java.lang.String[] subject,
java.lang.Object[] signalArgs)
receiver - The receiver for whom the signal is intended. Should not
be null.sender - The sender of the signal. Can be null. If this parameter is
null, it matches with only nodes that have registered to receive signals
from every possible sender.subject - A string array specifying the subject of the signal.signalArgs - The signal arguments. These should never be null or
empty.
public static void sendSignalTo(ID[] receivers,
ID sender,
java.lang.String[] subject,
java.lang.Object[] signalArgs)
Note that each node eligible to receive the signal is sent this signal only once.
sender - The sender of the signal. Can be null. If this parameter
is null, it matches with only nodes that have registered to receive
signals from every possible sender.subject - A string array specifying the subject of the signal.signalArgs - The signal arguments. These should never be null or
empty.public static void sendSignalTo(Signal signal)
Note that each node eligible to receive the signal is sent this signal only once.
signal - Signal containing an array of receivers, a
sender, a subject and of signal argumentspublic static void sendSignalLocal(java.lang.String signalArg)
signalArg - The name of the signal. This forms the first and only
signal argument.public static void sendSignalLocal(java.lang.Object[] signalArgs)
signalArgs - The signal arguments. These should never be null or
empty.
public static void sendSignalLocal(ID receiver,
java.lang.Object[] signalArgs)
receiver - The receiver for whom the signal is intended.signalArgs - The signal arguments. These should never be null or
empty.
public static void sendSignalLocal(ID receiver,
java.lang.String[] subject,
java.lang.Object[] signalArgs)
receiver - The receiver for whom the signal is intended.subject - A string array specifying the subject of the signal.signalArgs - The signal arguments. These should never be null or
empty.
public static void sendSignalLocal(ID receiver,
ID sender,
java.lang.String[] subject,
java.lang.Object[] signalArgs)
receiver - The receiver for whom the signal is intended.sender - The sender of the signal.subject - A string array specifying the subject of the signal.signalArgs - The signal arguments. These should never be null or
empty.
public static void sendSignalLocal(ID[] receivers,
ID sender,
java.lang.String[] subject,
java.lang.Object[] signalArgs)
receivers - An array of receivers for whom the signal is intended.sender - The sender of the signal.subject - A string array specifying the subject of the signal.signalArgs - The signal arguments. These should never be null or
empty.public static void sendSignalLocal(Signal signal)
signal - Signal containing an array of receivers, a
sender, a subject and of signal argumentspublic static void sendSignalGlobal(java.lang.Object[] signalArgs)
Note that each node eligible to receive the signal is sent this signal only once.
public static void sendSignalGlobal(java.lang.String[] subject,
java.lang.String signalArg)
Note that each node eligible to receive the signal is sent this signal only once.
public static void sendSignalGlobal(java.lang.String[] subject,
java.lang.Object[] signalArgs)
Note that each node eligible to receive the signal is sent this signal only once.
public static void sendSignalGlobal(ID sender,
java.lang.String[] subject,
java.lang.Object[] signalArgs)
Note that each node eligible to receive the signal is sent this signal only once.
public static void sendSignalGlobal(Signal signal)
Note that each node eligible to receive the signal is sent this signal only once.
signal - Signal containing an array of receivers, a
sender, a subject and array of signal arguments.public static Signal waitForSignal(java.lang.String[] subject)
subject - matches subject of signal
public static Signal waitForSignal(java.lang.String signalArg)
signalArg - simple signal argument consisting of a string
public static Signal waitForSignal(java.lang.Object[] pattern)
pattern - the pattern the signal is matched against.
public static Signal waitForSignal(java.lang.String[] subject,
SignalEvaluator func)
func - signal evaluation function
public static Signal waitForSignal(java.lang.String signalArg,
SignalEvaluator func)
signalArg - simple signal argument consisting of a stringfunc - signal evaluation function
public static Signal waitForSignal(SignalEvaluator func)
func - signal evaluation function
public static Signal waitForSignal(ID receiver,
ID sender,
java.lang.String[] subject,
java.lang.Object[] pattern,
SignalEvaluator func)
public static SignalWaitQueue createSignalQueue(java.lang.String[] subject)
public static SignalWaitQueue createSignalQueue(java.lang.Object[] pattern)
pattern - Object[] signal pattern
public static SignalWaitQueue createSignalQueue(SignalEvaluator func)
func - signal evaluation function
public static SignalWaitQueue createSignalQueue(java.lang.String[] subject,
SignalEvaluator func)
func - signal evaluation function
public static SignalWaitQueue createSignalQueue(ID receiver,
ID sender,
java.lang.String[] subject,
java.lang.Object[] pattern,
SignalEvaluator func)
receiver - recipient of the signalsender - sender of the signalpattern - the pattern the signal is matched against.func - signal evaluation function
public static Signal waitForQueuedSignal(SignalWaitQueue queue)
queue - SignalWaitQueue object returned from a call to
createSignalQueue
public static void failSelf(java.lang.String msg)
ScoreException - with specified detail messagepublic static void failSelf()
ScoreException - with no detail messagepublic static void addScenario(java.lang.Class newScenario)
Scenario class.
newScenario - new scenario class
public static void addScenario(java.lang.String name,
java.lang.Class newScenario)
newScenario - new scenario classname - the name to associate the new scenario class withpublic static java.util.Vector getScenarios()
public static java.util.Vector getScenarioNames()
public static void setCurrentScenario(java.lang.String scenName)
scenName - the name of the scenariopublic static void setCurrentScenario(Scenario scen)
scen - the scenariopublic static Scenario getCurrentScenario()
public static java.lang.String getCurrentScenarioName()
public static void startCurrentScenario()
public static void startCurrentScenario(OmarClock clock,
boolean isClockDaemonThread)
public static void stopCurrentScenario()
public static void pauseCurrentScenario()
public static void resumeCurrentScenario()
public static void getResource(Resource resource,
ScoreJThread owner,
int priority)
resource - resource to be acquired.owner - the new owner of the resource.priority - the priority at which the resources are requested.
public static void getResource(Resource[] resources,
ScoreJThread owner,
int priority)
resources - array of resources to be acquired.owner - the new owner of the resource.priority - the priority at which the resources are requested.
public static void releaseResource(Resource resource,
ScoreJThread owner)
resource - the resource to be released.owner - the current owner of the resource.
public static void releaseResource(Resource[] resources,
ScoreJThread owner)
owner - the current owner of the resources.
public static void transferOwnershipAndStart(ScoreJThread currentOwner,
Resource resource,
ScoreJThread newOwner)
resource - the resource whose ownership is to be transfered.
public static void transferOwnershipAndStart(ScoreJThread currentOwner,
Resource[] resources,
ScoreJThread newOwner)
resources - the set of resources whose ownership is to be transfered.
public static boolean isResourceAvailable(Resource resource,
int priority)
resource - the resource for which availability is checked.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||