repast.simphony.engine.watcher
Annotation Type Watch
@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface Watch
Annotation for creating a watcher.
- Version:
- $Revision: 1.1 $ $Date: 2005/12/21 22:25:34 $
- Author:
- Nick Collier
|
Optional Element Summary |
String |
id
Identifier for this Watch. |
int |
pick
The number of watchers to be triggered. |
String |
query
colocated - true if the watcher and the watchee are in the same context.
linked_to ['network name'] - true if the watcher is linked to the watchee in any network, or
optionally in the named network
linked_from ['network name'] - true if the watcher is linked from the watchee in any
network, or optionally in the named network
within X ['network name'] - true if the path from the watcher to the watchee is less
than or equal to X where X is a double precision number. |
double |
scheduleTriggerDelta
Defaults to 1 |
double |
scheduleTriggerPriority
Defaults to ScheduleParameters.RANDOM_PRIORITY |
boolean |
shuffle
Gets whether or not the list of watchers to be triggered is shuffled prior
to triggering. |
String |
triggerCondition
The trigger condition for triggering the method on which this is an annotation. |
watcheeClassName
public abstract String watcheeClassName
- The fully qualified class name of the watchee..
watcheeFieldNames
public abstract String watcheeFieldNames
- A comma separated list of the field names to watch in the watchee class.
whenToTrigger
public abstract WatcherTriggerSchedule whenToTrigger
- Gets when to trigger the watch: immediately or later.
- Returns:
- Gets when to trigger the watch: immediately or later.
id
public abstract String id
- Identifier for this Watch.
- Default:
- ""
query
public abstract String query
- colocated - true if the watcher and the watchee are in the same context.
- linked_to ['network name'] - true if the watcher is linked to the watchee in any network, or
optionally in the named network
- linked_from ['network name'] - true if the watcher is linked from the watchee in any
network, or optionally in the named network
- within X ['network name'] - true if the path from the watcher to the watchee is less
than or equal to X where X is a double precision number. This is either for any network in the context
or in the named network.
- within_vn X ['grid name'] - true if the watchee is in the watcher's von neumann neighborhood
in any grid projection or in the named grid. X is the extent of the neighborhood in the x, y,
[z] dimensions.
- within_moore X ['grid name'] - true if the watchee is in the watcher's moore neighborhood in
any grid projection or in the named grid. X is the extent of the neighborhood in the x, y, [z]
dimensions.
- within X ['geography name'] - true if the orthodromic distance from the watcher to
the watchee is less than or equal to X meters, otherwise false.
- Default:
- ""
triggerCondition
public abstract String triggerCondition
- The trigger condition for triggering the method on which this is an annotation. The trigger condition
is some arbitary boolean expression. The following variables are available to the expression $watcher, $watchee,
and $context. These correspond to the watcher, watchee and context. Methods can be called on these variables.
For example, $watcher.getAge() > 3, will call getAge on the watcher. The operators && and || are also
supported. For example, $watcher.getAge() > 3 && watcher.getAge() > $watchee.getAge()
- Default:
- ""
scheduleTriggerDelta
public abstract double scheduleTriggerDelta
- Defaults to 1
- Default:
- 1.0
scheduleTriggerPriority
public abstract double scheduleTriggerPriority
- Defaults to ScheduleParameters.RANDOM_PRIORITY
- Default:
- 0d/0d
pick
public abstract int pick
- The number of watchers to be triggered. The default is all
watchers.
- Returns:
- The number of watchers to be triggered.
- Default:
- 2147483647
shuffle
public abstract boolean shuffle
- Gets whether or not the list of watchers to be triggered is shuffled prior
to triggering. The default is true.
- Returns:
- whether or not the list of watchers to be triggered is shuffled prior
to triggering.
- Default:
- true