[Tinyos-contrib-commits]
CVS: tinyos-1.x/contrib/wustl/apps/AgillaAgents
Bounce0to1_100.ma, NONE, 1.1 RandomWalk.ma, NONE,
1.1 Traverse column B2T.ma, NONE, 1.1 Traverse column T2B.ma,
NONE, 1.1 Traverse perimeter.ma, NONE, 1.1 Traverse row L2R.ma,
NONE, 1.1 Traverse row R2L.ma, NONE, 1.1 VisitAll_L2R.ma, NONE,
1.1 VisitAll_ZigZag.ma, NONE, 1.1 VisitAll_ZigZag_noblink.ma,
NONE, 1.1
Chien-Liang Fok
chien-liang at users.sourceforge.net
Wed Apr 5 10:20:30 PDT 2006
Update of /cvsroot/tinyos/tinyos-1.x/contrib/wustl/apps/AgillaAgents
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32352
Added Files:
Bounce0to1_100.ma RandomWalk.ma Traverse column B2T.ma
Traverse column T2B.ma Traverse perimeter.ma
Traverse row L2R.ma Traverse row R2L.ma VisitAll_L2R.ma
VisitAll_ZigZag.ma VisitAll_ZigZag_noblink.ma
Log Message:
--- NEW FILE: Bounce0to1_100.ma ---
pushcl 100
BEGIN dec // decrement the counter
copy
pushc 0
cneq
rjumpc CONT
halt // halt the agent
CONT pushc 25
putled // toggle the red LED
pushc 2
sleep // sleep for 1/4 second
pushc 25
putled // toggle the red LED
addr
pushc 0
ceq
rjumpc GOTO1
GOTO0 pushc 0
smove
pushc BEGIN
jumps
GOTO1 pushc 1
smove
pushc BEGIN
jumps
--- NEW FILE: RandomWalk.ma ---
BEGIN pushc 26
putled // toggle green LED
pushc 1
sleep // sleep for 1/8 second
pushc 26
putled // toggle green LED
randnbr // get a random neighbor
rjumpc MIGRATE
rjump BEGIN
MIGRATE wmove
pushc BEGIN
jumps
--- NEW FILE: Traverse column B2T.ma ---
// Inject this agent onto any agent on the bottom border, watch
// it migrate across the column. It turns on the red LED upon
// arrival
BEGIN pushc 1
putled // turn on red LED
pushc 2
setvar 11 // consider only Y coordinate
loc
inc
copy
cisnbr
rjumpc MOVE
halt
MOVE wmove
halt
--- NEW FILE: Traverse column T2B.ma ---
// Inject this agent onto any agent on the top border, watch
// it migrate across the column. It turns on the red LED upon
// arrival
BEGIN pushc 1
putled // turn on red LED
pushc 2
setvar 11 // heap[11] = 2, consider only Y coordinate
loc
dec
copy
cisnbr
rjumpc MOVE
halt
MOVE wmove
halt
--- NEW FILE: Traverse perimeter.ma ---
// Inject this agent onto (1,1) and watch as it traverses the border
// of the entire sensor network. It turns on the red LED upon
// arrival.
BEGIN_RIGHT pushc 1
setvar 15 // consider only X coordinate
GO_RIGHT pushc 1
putled // turn on red LED
loc
inc
copy
cisnbr
rjumpc MOVE_RIGHT
pop
rjump BEGIN_UP
MOVE_RIGHT smove
rjump GO_RIGHT
BEGIN_UP pushc 2
setvar 15 // consider only Y coordinate
GO_UP pushc 1
putled // turn on red LED
loc
inc
copy
cisnbr
rjumpc MOVE_UP
pop
rjump BEGIN_LEFT
MOVE_UP smove
rjump GO_UP
BEGIN_LEFT pushc 1
setvar 15 // consider only X coordinate
GO_LEFT pushc 1
putled // turn on red LED
loc
dec
copy
cisnbr
rjumpc MOVE_LEFT
pop
rjump BEGIN_DOWN
MOVE_LEFT smove
rjump GO_LEFT
BEGIN_DOWN pushc 2
setvar 15 // consider only Y coordinate
GO_DOWN pushc 1
putled // turn on red LED
loc
dec
copy
cisnbr
rjumpc MOVE_DOWN
pop
rjump STOP
MOVE_DOWN smove
rjump GO_DOWN
STOP pushc 2
putled
halt
--- NEW FILE: Traverse row L2R.ma ---
// Inject this agent onto any agent on the left border, watch
// it migrate across the row. It turns on the red LED upon
// arrival
BEGIN pushc 1
putled // turn on red LED
pushc 1
setvar 15// heap[15] = 1, consider only X coordinate
loc
inc
copy
cisnbr
rjumpc MOVE
halt
MOVE wmove
halt
--- NEW FILE: Traverse row R2L.ma ---
// Inject this agent onto any agent on the right border, watch
// it migrate across the row. It turns on the red LED upon
// arrival
BEGIN pushc 1
putled // turn on red LED
pushc 1
setvar 11 // heap[11] = 1, consider only X coordinate
loc
dec
copy
cisnbr
rjumpc MOVE
halt
MOVE wmove
halt
--- NEW FILE: VisitAll_L2R.ma ---
// This agent visits every mote, turning on the red LED.
// Visits each row from left-to-right.
BEGIN pushloc 7 7
loc
ceq
pushc BLINKGREEN
jumpc // do not clone to next node
loc
pushc 1
setvar 11 // heap[11] = 1 (analyze x-coordinate only)
inc
wclone // clone at next node
rjumpc BLINKGREEN // blink green if clone succeeded
BLINKRED pushc 25 // blink red if clone failed
putled
pushc 8
sleep
rjump BLINKRED
BLINKGREEN pushc 26
putled
pushc 1
sleep
rjump BLINKGREEN
--- NEW FILE: VisitAll_ZigZag.ma ---
// Clones itself throughout the network by zig-zagging across
// each row, starting by going left-to-right on row 1.
//
// Usage: Inject this agent onto node (0,0).
BEGIN pushc 0
setvar 0 // heap[0] = 0, this means the agent is moving right
INIT pushc 1
setvar 15 // consider only x coordinate
MAINLOOP loc
getvar 0
pushc 0
ceq
rjumpc CHECK_RIGHT
CHECK_LEFT dec // top of stack = (x-1,y)
cisnbr
rjumpc GO_LEFT // jump to GO_LEFT if there is a left neighbor
pushc CHECK_UP
jumps // jump to CHECK_UP if no left neighbor
CHECK_RIGHT inc // top of stack = (x+1,y)
cisnbr
rjumpc GO_RIGHT // jump to GO_RIGHT if there is a right neighbor
pushc CHECK_UP
jumps // jump to CHECK_UP if no right neighbor
GO_LEFT loc
dec
sclone
cpush
pushc 2
ceq
pushc MAINLOOP
jumpc // child jumps back to main loop
pushc BLINKGREEN
jumps // parent jumps to blink green
GO_RIGHT loc
inc
sclone
cpush
pushc 2
ceq
pushc MAINLOOP
jumpc // jump to main loop of child
pushc BLINKGREEN
jumps // blink green after clone
CHECK_UP pushc 2
setvar 15 // consider only y coordinate
loc
inc
copy
cisnbr
rjumpc GO_UP
pushc BLINKGREEN
jumps // blink green if no northern neighbor
GO_UP getvar 0
pushc 0
ceq
rjumpc SET_LEFT
pushc 0
setvar 0 // heap[0] = 0 (go right)
rjump GO_UP2
SET_LEFT pushc 1
setvar 0 // heap[0] = 1 (go left)
GO_UP2 sclone
cpush
pushc 2
ceq
pushc INIT
jumpc // child goes to init after moving up
// parent goes to BLINKGREEN
BLINKGREEN pushc 26
putled
pushc 1
sleep
rjump BLINKGREEN
--- NEW FILE: VisitAll_ZigZag_noblink.ma ---
// Clones itself throughout the network by zig-zagging across
// each row, starting by going left-to-right on row 1.
//
// Usage: Inject this agent onto node (0,0).
BEGIN pushc 0
setvar 0 // heap[0] = 0, this means the agent is moving right
INIT pushc 1
setvar 11 // consider only x coordinate
MAINLOOP loc
getvar 0
pushc 0
ceq
rjumpc CHECK_RIGHT
CHECK_LEFT dec // top of stack = (x-1,y)
cisnbr
rjumpc GO_LEFT // jump to GO_LEFT if there is a left neighbor
pushc CHECK_UP
jumps // jump to CHECK_UP if no left neighbor
CHECK_RIGHT inc // top of stack = (x+1,y)
cisnbr
rjumpc GO_RIGHT // jump to GO_RIGHT if there is a right neighbor
pushc CHECK_UP
jumps // jump to CHECK_UP if no right neighbor
GO_LEFT loc
dec
sclone
cpush
pushc 2
ceq
pushc MAINLOOP
jumpc // child jumps back to main loop
pushc BLINKGREEN
jumps // parent jumps to blink green
GO_RIGHT loc
inc
sclone
cpush
pushc 2
ceq
pushc MAINLOOP
jumpc // jump to main loop of child
pushc BLINKGREEN
jumps // blink green after clone
CHECK_UP pushc 2
setvar 11 // consider only y coordinate
loc
inc
copy
cisnbr
rjumpc GO_UP
pushc BLINKGREEN
jumps // blink green if no northern neighbor
GO_UP getvar 0
pushc 0
ceq
rjumpc SET_LEFT
pushc 0
setvar 0 // heap[0] = 0 (go right)
rjump GO_UP2
SET_LEFT pushc 1
setvar 0 // heap[0] = 1 (go left)
GO_UP2 sclone
cpush
pushc 2
ceq
pushc INIT
jumpc // child goes to init after moving up
// parent goes to BLINKGREEN
BLINKGREEN pushc 26
putled
halt
More information about the Tinyos-contrib-commits
mailing list