Advertisement
rodolpheg

Untitled

Nov 18th, 2020
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. // Nom du modèle
  2. model trafic
  3.  
  4. // Méthode globale définissant l'environnement.
  5. global {
  6. file shp_bati <- file("../includes/bati.shp");
  7. file shp_rue <- file("../includes/rues_vm.shp");
  8. geometry shape <- envelope(shp_rue);
  9. graph reseau;
  10.  
  11. init {
  12. create bati from: shp_bati;
  13. create rue from: shp_rue ;
  14. reseau <- as_edge_graph(shp_rue);
  15. create resident number: 100 {
  16. location <- any_location_in(one_of(list<bati>(bati)));
  17. }
  18. }
  19. }
  20.  
  21. // Agent "bati"
  22. species bati {
  23. aspect base {
  24. draw shape color: #red ;
  25. }
  26. }
  27.  
  28. // Agent "rue"
  29. species rue {
  30. rgb color <- #black ;
  31. aspect base {
  32. draw shape color: color ;
  33. }
  34. }
  35.  
  36. species resident {
  37. rgb color <- #blue;
  38. aspect base {
  39. draw circle(20) color: color;
  40. }
  41. }
  42.  
  43. // Définition de la simulaiton et de ses affichages
  44. experiment trafic type: gui {
  45. output {
  46. display ville_marie type:opengl {
  47. species bati aspect: base ;
  48. species rue aspect: base ;
  49. species resident aspect: base;
  50. }
  51. }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement