Giter Site home page Giter Site logo

munterfi / sbplanr Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 86.59 MB

Tool for placing bicycle sharing stations by iteratively minimizing a global energy of a model that reflects the station-based bicycle sharing system.

Home Page: https://munterfi.github.io/sbplanr/

License: GNU General Public License v3.0

R 100.00%

sbplanr's Introduction

Station-based bicycle sharing planner

Lifecycle: experimental R build status pkgdown Codecov test coverage

Tool for placing bicycle sharing stations by iteratively minimizing a global energy of a model that reflects the station-based bicycle sharing system. The station locations are randomly initialized in the street network and iteratively optimized based on the reachable population in combination with walking and driving times. Initially forked from munterfi/drtplanr.

The model in the package example optimizes the positions of stations in an assumed bicycle sharing service for the municipality Bülach in Zurich, Switzerland.

Getting started

Install the development version from GitHub with:

remotes::install_github("munterfi/sbplanr")

Create an example model:

# Example data
aoi <-
  sf::st_read(system.file("example.gpkg", package = "sbplanr"), layer = "aoi")

pop <-
  sf::st_read(system.file("example.gpkg", package = "sbplanr"), layer = "pop")

poi <-
  sf::st_read(system.file("example.gpkg", package = "sbplanr"), layer = "poi")[1,]

# Create model
m <- sb_sbm(
  model_name = "Buelach",
  aoi = aoi, pop = pop, poi = poi,
  n_sta = 15, m_seg = 100
)

# Iterate the model
m <- sb_iterate(m, 100)

# Visualize results
sb_plot(m)
sb_map(m)

Structure of the model

Input layers

The model is set up with the following inputs:

  • Spatial layer:
    • Area of Interest (POLYGON).
    • Population raster centroids (POINT).
    • Point(s) of Interest (POINT).
  • Parameters:
    • A model name.
    • Distance in meters to segment the street network for candidate creation: default = 100m (The value is equivalent to the minimum possible distance between two stations on the street network).
    • Number of stations to place.

Global energy

Function that calculates the global energy of the current model state. The aim is to place the station in a way, that the residents and workers around them have to walk as short as possible to the station and that the station is connected as well as possible to other attractive stations in the network. An attractive station is a station with many people in the catchment area that can be quickly reached by bicycle.

When the direct walking time between to populations is faster than the travel using the bicycle (walk to station, cycle, walk from station), than the direct walking travel is chosen.

Optimization

The global energy of the model is optimized in iterations. In every iteration one station is randomly selected and moved to another position on the segmented street network. The global energy of the model state with the new candidate is calculated. If the global energy is lower as befor, the candidate is accepted and the next iteration starts. If the global energy is higher, the candidate is rejected with the probability $1-\alpha$. The probability $\alpha$ decreases exponentially as a function of the number of iterations ($i$):

The concept of sometimes allowing a bad candidate to be accepted is known as annealing. This technique prevents the optimization from being captured in a local minimum before the global minimum is reached.

Authors

  • Merlin Unterfinger (inital idea, package implementation) - munterfi
  • Thomas Hettinger (energy definition) - thetti
  • David Masson (ideas and feedback on model optimization, annealing) - panhypersebastos

References

  • Initially forked from munterfi/drtplanr
  • hereR: R interface to the HERE REST APIs
  • BfS: Population data for Switzerland
  • OSM: Street network data for routing purposes.

Licence

  • This repository is licensed under the GNU General Public License v3.0 - see the LICENSE.md file for details.

sbplanr's People

Contributors

munterfi avatar

Stargazers

 avatar

Watchers

 avatar

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.