! [, ~" _/ V4 R+ ? // This is an agent decision.7 O! b5 }3 {! D! Q, z
if (watchedNode.pressure<200) { + l: h# u6 J* A$ ~* m, `4 ]% x. P5 ]" e p" r$ s
// This is a task./ N/ P( C" h' }. B
setPressure(watchedAgent.pressure)$ ?" l# i+ a/ S9 `8 j! d
* I7 J6 G6 M! @1 G0 W } else {5 C% V' j* m: v/ M$ ?! G7 n% I, S! ?5 o
8 p n' `' Q( d0 y5 H
5 s6 g% p2 d2 A# F& v; x { } + D/ y6 g+ J/ n/ |4 ~, o( j // Return the results. V: \8 a& i M. T1 X* v! o2 C return returnValue1 I0 x7 K# F+ {9 _5 L
" n# C! W! Y; S }# |- E; H7 R! }0 }; Q% ]8 ]7 I
+ J2 n2 `: j' t/ b. \9 K* E /** $ |8 I! R5 o( v. M* ^7 z6 h1 e * 5 k$ E- D, b/ d% y * This is the step behavior. & u5 @' ?% g d4 h4 ~6 J6 x6 w/ A5 B * @method step - y' m9 ]7 ?# x; I& }( Y ** L* u8 \+ q5 e5 Z
*/; ~# L1 c* m4 ~3 u1 [. Q( c
@ScheduledMethod( f3 p0 F: T; S& ~7 C+ x0 { start = 1d, 2 ?" w* J: h( z- o& R interval = 1d,9 K. z" G- C3 {; s+ b! F/ t
shuffle = false, e5 l. d: q! Q0 y4 n
)% i ~. {& `& ^# F' x
public void step() { 1 @& Z( `2 {2 \4 x # p: a+ M( a4 _2 O6 ?, J // Note the simulation time. ; Y" \- S; x g8 m: z$ k# e def time = GetTickCountInTimeUnits() 7 z, o0 \* D2 n+ R% b# w* o$ t9 x) R* S' t7 z3 e; D$ c
// This is a task.6 u) s3 b4 o& \2 Q; t% ^
measurePressure=pressure+ RandomDraw(-20.0, 20.0)+ T- `/ p l- |* i- n
// End the method., o& m" e( [! A" m' p
return 2 R( j+ @, G2 h; i3 F/ X) Y7 k3 |; R& z; Y5 n
}