Coder Social home page Coder Social logo

smarttransitionsim.jl's Introduction

SmartTransitionSim.jl

Smart cars transition multi-agent simulator created in Julia

Documentation

Build status

Build Status codecov

This is a repository containig a simulation model accompying the paper:

Multi-agent routing simulation with partial smart vehicles penetration

by Bogumił Kamiński, Łukasz Kraiński, Atefeh (Atty) Mashatan Paweł Prałat and Przemysław Szufel

Journal of Advanced Transportation, Volume 2020 DOI

Agent-based Simulation Framework for modelling transport systems with partial smart vehicles penetration

The framework was optimized in terms of performance. Major performance tweaks include:

  • Yen's algorithm is based on custom, fast A-star implementation - 5 times performance improvement over a standard Julia implementation,
  • routes calculated by the k-shortest paths algorithm are saved for future re-use (memoization technique) - leading to up to 15 times faster simulation execution in comparison to no-memoization,
  • simulations use common, separately generated agents pools - halved overall running time.

We have designed the simulation tool in such a way that the simulations can be executed in a distributed fashion. Additionally the simulation model has been adjusted to work with KissCluster software KissCluster that can be used to manage the distributed simulation execution and the data collection process in the Amazon Web Service cloud.

In order to run the simulation please execute the following julia commands:

using Pkg
Pkg.add(PackageSpec(url="https://github.com/KrainskiL/SmartTransitionSim.jl"))

Once the simulation package with its dependencies is installed get the run_sweep_v4_NoSerial-1.jl (available in the example project subfolder) to actually run the simulations. In order to to parallelize the simulation over a computational cluster you need to use external software. To start simulation, run the command:

julia example/run_sweep_v4_NoSerial-1.jl 1

where 1 is the value that will be parsed as the sweep parameter

smarttransitionsim.jl's People

Contributors

krainskil avatar pszufe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

smarttransitionsim.jl's Issues

what's wrong here trying to run the project

Installed the package

(@v1.10) pkg> st
Status `~/.julia/environments/v1.10/Project.toml`
  [a93c6f00] DataFrames v1.6.1
  [4dc1fcf4] DotEnv v1.0.0
⌃ [cd3eb016] HTTP v1.10.3
  [682c06a0] JSON v0.21.4
  [0f8b85d8] JSON3 v1.14.0
  [5fb14364] OhMyREPL v0.5.24
  [e9f21f70] OpenAI v0.9.0
  [d7c9b1e0] SmartTransitionSim v0.1.0 `https://github.com/KrainskiL/SmartTransitionSim.jl#master`
  [2913bbd2] StatsBase v0.34.2
  [21ca0261] Transformers v0.2.8 `~/.julia/dev/Transformers`
  [37e2e46d] LinearAlgebra
Info Packages marked with ⌃ have new versions available and may be upgradable.

and then basically trying to run the project with given instructions

SmartTransitionSim.jl [ master][📦 v0.1.0][ஃ v1.10.2]
❯ julia example/run_sweep_v4_NoSerial-1.jl 1
ERROR: LoadError: MethodError: no method matching yen_a_star(::Graphs.SimpleGraphs.SimpleDiGraph{Int64}, ::Int64, ::Int64, ::SparseArrays.SparseMatrixCSC{Float64, Int64}, ::Int64)

Closest candidates are:
  yen_a_star(::LightGraphs.AbstractGraph, ::Int64, ::Int64, ::AbstractMatrix, ::Int64)
   @ SmartTransitionSim ~/.julia/packages/SmartTransitionSim/ANKlZ/src/rerouting.jl:108
  yen_a_star(::LightGraphs.AbstractGraph, ::Int64, ::Int64, ::AbstractMatrix)
   @ SmartTransitionSim ~/.julia/packages/SmartTransitionSim/ANKlZ/src/rerouting.jl:108
  yen_a_star(::LightGraphs.AbstractGraph, ::Int64, ::Int64)
   @ SmartTransitionSim ~/.julia/packages/SmartTransitionSim/ANKlZ/src/rerouting.jl:108

Stacktrace:
 [1] k_shortest_path_rerouting!(OSMmap::OpenStreetMapX.MapData, k_routes_dict::Dict{Tuple{Int64, Int64}, Array{Vector{Int64}}}, inAgent::Agent, speeds::SparseArrays.SparseMatrixCSC{Float64, Int64}, max_speeds::SparseArrays.SparseMatrixCSC{Float64, Int64}, k::Int64, T::Float64, upd_period::Int64, seed::Int64)
   @ SmartTransitionSim ~/.julia/packages/SmartTransitionSim/ANKlZ/src/rerouting.jl:64
 [2] k_shortest_path_rerouting!(OSMmap::OpenStreetMapX.MapData, k_routes_dict::Dict{Tuple{Int64, Int64}, Array{Vector{Int64}}}, inAgent::Agent, speeds::SparseArrays.SparseMatrixCSC{Float64, Int64}, max_speeds::SparseArrays.SparseMatrixCSC{Float64, Int64}, k::Int64, T::Float64, upd_period::Int64)
   @ SmartTransitionSim ~/.julia/packages/SmartTransitionSim/ANKlZ/src/rerouting.jl:27
 [3] generate_agents(OSMmap::OpenStreetMapX.MapData, N::Int64, StartArea::Vector{Rect}, EndArea::Vector{Rect}, α::Float64, k::Int64, T::Float64, AvgStartTime::Float64, k_routes_dict::Dict{Tuple{Int64, Int64}, Array{Vector{Int64}}})
   @ SmartTransitionSim ~/.julia/packages/SmartTransitionSim/ANKlZ/src/generate_agents.jl:116
 [4] top-level scope
   @ ~/Git/SmartTransitionSim.jl/example/run_sweep_v4_NoSerial-1.jl:33
in expression starting at /Users/abhi/Git/SmartTransitionSim.jl/example/run_sweep_v4_NoSerial-1.jl:33

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.