make agents flow in a order as per the list

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

make agents flow in a order as per the list

neettakoli-2
Hi,

 I am trying to build ( resource utilization model for an hospital ), wherein my agents are patients, surgeons, and beds. I want the patients and surgeons to flow in an order to the operation room patch where 3 beds are available. I have created 2 list scheduled surgery list and actual surgery list ( what happens on the day). If the who id on both the lists are same only then patient flowsfor which i worte the following, it shows no syntax error but it isnt working as well.
 If you can suggest better way please.
 TO proceed-to-operation
ask one-of patients [
    foreach scheduled-surgery-list-OR1 [ num -> if num = who and ( position who scheduled-surgery-list-OR1 = position who actual-surgery-list-OR1 )
      [ ask one-of patients [ move-to patch-at 2 14 ] ]
      wait 2
 set scheduled-surgery-list-OR1 remove WHO scheduled-surgery-list-OR1 ]
 print "error" ]