ROSBuzz_MISTLab/script/stand_by.bzz

34 lines
509 B
Plaintext
Raw Normal View History

updated="update_ack"
update_no=0
function init(){
barrier = stigmergy.create(101)
barrier.put(id,1)
barrier_val=0
barrier.onconflict(function (k,l,r) {
if(r. data < l. data or (r. data == l. data )) return l
else return r
})
}
function stand_by(){
barrier.get(id)
barrier_val = barrier.size()
neighbors.listen(updated,
function(vid, value, rid) {
2017-01-27 13:38:20 -04:00
print(" got from",vid," ", " value = ",value," ","rid"," " )
if(value==update_no) barrier_val=ROBOTS
}
)
}
function step() {
stand_by()
}