项目作者: ragreener1

项目描述 :
An agent-based model of active travel
高级语言: Rust
项目地址: git://github.com/ragreener1/Motivate.git
创建时间: 2018-06-19T07:55:11Z
项目社区:https://github.com/ragreener1/Motivate

开源协议:MIT License

下载


Motivate Build Status

Setup

Install rust using rustup

Running Motivate

Configuration

config/parameters.yaml

  1. ---
  2. total_years: the number of years the simulation runs for
  3. number_of_people: the number of people in the simulation
  4. number_of_simulations: the number of simulations to run in parallel
  5. social_connectivity: how connected an agent is to its social network
  6. subculture_connectivity: how connected an agent is to its subculture
  7. neighbourhood_connectivity: how connected an agent is to its neighbourhood
  8. number_of_social_network_links: the minimum number of links an agent should have in its social network
  9. number_of_neighbour_links: the minimum number of neighbours an agent should be influenced by
  10. days_in_habit_average: the number of days that account for approximately 86% of the habit average
  11. distributions: this should not be changed

config/scenario.yaml

  1. ---
  2. id: the name of the scenario
  3. subcultures: <- these are the subcultures in the scenario, currently an equal amount of agents in each
  4. - id: Subculture A <- the name of the subculture
  5. desirability: <- the desirability scores of transport modes in the subculture from 0 - 1
  6. PublicTransport: 0.5
  7. Walk: 0.699999988079071
  8. Car: 0.800000011920929
  9. Cycle: 0.8999999761581421
  10. < other subcultures omitted >
  11. neighbourhoods:
  12. - id: "0" <- the name of the subulture
  13. supportiveness: <- how supportive the neighbourhood is for a transport mode
  14. Cycle: 0.699999988079071
  15. Walk: 0.800000011920929
  16. Car: 0.8999999761581421
  17. PublicTransport: 0.8999999761581421
  18. capacity: <- the maximum capacity at which there is no congestion penalty
  19. Car: 3600
  20. Cycle: 150000
  21. Walk: 150000
  22. PublicTransport: 3000
  23. < other neighbourhoods omitted >
  24. number_of_bikes: 10000 <- How many bikes are in the scenario
  25. number_of_cars: 5000 <- How many cars are in the scenario
  26. intervention: <- The intervention that should occur
  27. day: 365 <- The day at which the intervention takes place
  28. neighbourhood_changes:
  29. - id: "0" <- The ID of the neighbourhood to change
  30. increase_in_supportiveness: <- How to change the supportiveness, be careful that this does not make the supportiveness < 0 or > 1
  31. Car: -0.1
  32. Cycle: 0.1
  33. < fields with no change are not required >
  34. increase_in_capacity: <- Be careful this does not make the capacity < 0
  35. Car: -4000
  36. PublicTransport: -100
  37. < if there is no increase_in_supportiveness or increase_in_capacity the respective field can be left out e.g. >
  38. - id: "1"
  39. increase_in_capacity:
  40. Car: -100
  41. - id: "2"
  42. increase_in_supportiveness:
  43. Walk: 0.4
  44. Cycle: 0.3
  45. < other changes to the neighbourhood can be added in the same way >
  46. subculture_changes:
  47. - id: Subculture A <- The ID of the Subculture to change
  48. increase_in_desirability: <- How to change the desirability, be careful that this does not make the desirability < 0 or > 1
  49. Car: -0.1
  50. Cycle: 0.1
  51. < fields with no change are not required >
  52. < other changes to the subculture can be added in the same way >
  53. change_in_number_of_bikes: 10000 <- An increase (or decrease) in the number of bikes
  54. change_in_number_of_cars: -100 <- An increase (or decrease) in the number of cars

Running the simulation

On the first run of the simulation run cargo run --release -- --generate,
so that social networks are generated.

Afterwards in the root of the repository run cargo run --release.

Generating Documentation

Documentation can be generated by running cargo rustdoc -- --document-private-items

Notes

As specified in .cargo/config the generated executable will target the cpu it is compiled on,
therefore binaries created on one system, may not execute on other systems, even if they run
the same operating system. To remove this requirement remove -C target_cpu=native from .cargo/config,
however this could have an impact on performance.