% b( t8 i' }0 P! P3 l1 g@Parameter (displayName = "Measured Pressure", usageName = "measured pressure")) x9 ^; m& Z0 h0 A, x. c
public double getMeasured pressure() {4 U8 n7 ?3 s6 s
return measured pressure $ g! a+ V* }! S3 @# U \ }( `# l \7 [. R7 F- ~
public void setMeasured pressure(double newValue) { ! Q" I3 }0 A2 E: i l3 n measured pressure = newValue6 h: |2 ~. `) `7 N4 g
} ( v9 t8 z# Q) c9 Y; A; v; |, i public double measured pressure = 0 - w5 e, |' [: d$ z& M5 Z) l/ K/ M; q+ e, J# q
/** 4 m' f/ p& O3 m( R& d* s5 c9 a * + ?4 n. F$ D2 y. z9 k s' p * This value is used to automatically generate agent identifiers.1 j& j% _9 V+ g" g$ ~+ s
* @field serialVersionUID 9 ~4 q% z" r- E: H6 }' f * 5 f0 W+ c. x. F |4 B/ n5 } */) y: i. n/ J& o* P, q1 g
private static final long serialVersionUID = 1L 9 L8 D7 ]) V5 }- K k) a9 h; O% J/ Y5 W) B
/** 9 Q v9 J9 x- g, x$ j" Y& d/ w% o$ z * 8 W: E: e) S# A" U# W8 a * This value is used to automatically generate agent identifiers.1 S$ y# @: s1 N r7 b, V# l: A
* @field agentIDCounter7 O+ n8 K. x9 [7 ~
*' q* T" k; ^! b7 B* I! ^8 V6 t
*/ ) u1 m" T- c R9 J8 A protected static long agentIDCounter = 1 1 x/ ^" w' f/ R# g$ Z2 _0 r2 l3 E. m3 l' a C! s) Q) B! k
/** # F/ f" i6 b! ?( H * + ^+ q& K+ l) x; O * This value is the agent's identifier.; H6 A# A+ d: g
* @field agentID " q7 E, b+ m+ u& w7 l * 5 h) c8 L4 W/ g */' Y f9 H! s* S% a2 ?# {! N
protected String agentID = "GasNode " + (agentIDCounter++) + z) D, O w2 V$ f% G* I0 o7 [1 Y9 U8 I: h
/** ; u/ {; H7 K1 I6 G5 ?2 S2 ] * ; v1 o% Y- O" K- }/ x * This is the step behavior. 5 k% O/ ?% j% U! \ * @method step! y$ f. E: a0 l, {7 C% z
* z/ r* Z, f& ]& V */ . ~( ^! R0 ?+ R% o; m @Watch( # o. {* d7 f9 S3 q9 X% i/ o watcheeClassName = 'infrastructuredemo.GasNode',' I/ n: a3 M u9 C# x& U6 s% L
watcheeFieldNames = 'pressure',1 g7 b9 h( X) }# n8 ~5 C+ ]( Z; n$ {6 V
query = 'linked_from', ) w0 R; }: J1 B( D, B7 s whenToTrigger = WatcherTriggerSchedule.LATER,* U$ v: I6 Y5 ]9 w& ]9 e- U- _3 V* L5 [
scheduleTriggerDelta = 10d : ^' x5 P4 R5 u# P) q a$ `+ m( Y; } )3 u# Y. ~. L. _& ~& E }7 s. S
public def step(infrastructuredemo.GasNode watchedAgent) { ( x A k3 I: {/ F% I v" t5 h) }+ {" {: Y- [2 A // Define the return value variable.2 z' c1 W2 U$ a
def returnValue ( ]8 r2 m5 h: }7 Y5 ^, P% ?. Y% }! u; s
// Note the simulation time." T6 K; D. Y2 l3 e `% P
def time = GetTickCountInTimeUnits() * L& N \# d* x/ q6 ~( T7 [- H/ y ~
$ ~# A& m1 y0 V2 h. n // This is an agent decision.! V' W3 Q. ?* G1 y
if (watchedNode.pressure<200) { / I6 ?; K0 j( @% N5 Y" f a 9 Z7 E4 |9 g2 T* H2 l) v! a8 [ // This is a task.9 }; d& M8 I; |# i$ o" g) q
setPressure(watchedAgent.pressure): y. J# T) O; l