Advertisement
rodolpheg

Untitled

Nov 19th, 2020
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. // À chaque itération, regarder si la variable destination est différente "nil"
  2. reflex move when: target != nil {
  3. // On trouve les segments de rues et on passe à travers la liste
  4. path chemin <- goto(target: target, on:reseau, return_path: true);
  5. list<geometry> segments <- chemin.segments;
  6. loop ligne over: segments {
  7. float dist <- ligne.perimeter;
  8. ask rue(chemin agent_from_geometry ligne) {
  9. // calcul du nouveau coefficient d'utilisation qui servira au calcul de la couleur
  10. usage_coeff <- usage_coeff + (usage * dist / shape.perimeter);
  11. }
  12. }
  13. if target = location {
  14. // une fois arrivé, sa destination devient nil
  15. target <- nil ;
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement