Questions tagged [simpy]

A discrete-event simulation framework for Python

SimPy is a process-based discrete-event simulation framework based on standard Python. Its event dispatcher is based on Python’s generators and can also be used for asynchronous networking or to implement multi-agent systems (with both, simulated and real communication).

341 questions
7
votes
3 answers

Python, SimPy: How to generate a value from a triangular probability distribution?

I want to run a simulation that uses as parameter a value generated from a triangular probability distribution with lower limit A, mode B and and upper limit C. How can I generate this value in Python? Is there something as simple as…
andandandand
  • 21,946
  • 60
  • 170
  • 271
6
votes
5 answers

Visualization of a discrete-event simulation on a grid / warehouse layout

I need to simulate a warehouse with several autonomous vehicles moving on a given layout with simple priority rules. In my understanding, the problem can easily be tackled with discrete-event simulation (DES) and I would use SimPy for this. The…
mondano
  • 827
  • 10
  • 29
6
votes
4 answers

'builtin_function_or_method' object has no attribute 'randrange'

i am having a weird issue, i have created the following code to randomly generate numbers between 1 and x with increments of 1 and to store them import random bootstrap_node_list_recieved = [] #List of all nodes addresses recieved during the…
user4017041
  • 113
  • 1
  • 1
  • 8
5
votes
1 answer

Simpy Error with environment

I have installed Simpy, and I use Python 3.5. I have the same error: >>> env = simpy.Environment() Traceback (most recent call last): File "", line 1, in env = simpy.Environment() AttributeError: module 'simpy' has no…
plr
  • 244
  • 1
  • 15
4
votes
1 answer

Need help modeling a train system with SimPy

I need help modeling a train system (like a subway system) in SimPy, the problem is that my "Simulation" teacher wants me to use Python + SimPy and I don't have a clue how to use it, after a week reading about SimPy I managed to understand the bank…
nosmirck
  • 666
  • 9
  • 31
4
votes
2 answers

Change the number of resources during simulation in simpy

I am currently working on a model which simulates a delivery process throughout an operating day in simpy. The deliveries are conducted by riders which are delivering one package at a time. The packages need to be delivered within a certain time…
Joost Loth
  • 43
  • 2
4
votes
1 answer

How can I run concurrent "tasks" in Python with SimPy, where each task is waiting for multiple resources?

The system that I am modelling has objects that require maintenance in the form of a series of tasks. Currently in this model, they request a "work location", then once they have seized that, they request the necessary "worker" resources they need…
Charles Bushrow
  • 437
  • 4
  • 12
4
votes
2 answers

How to document simulations with parallel processes?

I've been using the SimPy module for Python - that does Discrete Event Simulations. Now, the code has gotten fairly large now and there are quite a few processes occurring in parallel that interact with one another. How is the best way to show this…
4
votes
2 answers

Resource not releasing in Simpy - what am I doing wrong?

I have simplified the code representing the problem as suggested and attempted to debug. Here is the most simple version of the code which still contains the bug: import simpy SIM_TIME = 5 def source(env): i = 0 while True: i…
Harry Munro
  • 304
  • 2
  • 12
4
votes
2 answers

Requesting First available resource in simpy python

I want to create a simulation model that simulates a bank with 3 number of counters. I want there to be one queue for customers, and if any one of the counters is available, it will service the counter for some amount of time. Each counter is its…
CameronB
  • 83
  • 8
3
votes
1 answer

Monte Carlo Simulation : Underlying distribution parameter changes during simulation run based on conditions

I am trying to simulate running of two manufacturing lines (Line A and Line B).Their time to failure follows Weibull distribution(shape = 0.7, scale = 12 (mins)). Line A and Line B both produces at rate of 100 products/min. From real world scenario,…
Jai Pandey
  • 33
  • 6
3
votes
2 answers

How to Put an indefinite Integral in an objective function Python

I have this objective function that I want to minimize in regards to 't', and in this function, there is an integral from 0 to t that has to be considered for the optimization. However, I have no Idea how to include this integral to my objective…
3
votes
1 answer

Can I use simpy to do agent-based simulation?

I know that simpy is a process-based discrete-event simulation framework. I have several agents that might do different things at the same time. Can I still use simpy to simulate my agents? For example, a car arrives to a parking lot. Then the…
3
votes
2 answers

how to debug in simpy

I have a general question about how to debug in Simpy. Normal debugging tools don't seem to work, since everything is working on the event loop, and you can't step through the code line by line and inspect what exists at any point in…
Allen Wang
  • 2,426
  • 2
  • 24
  • 48
3
votes
0 answers

Open-source animation library compatible with simpy

Is it possible to combine simpy discrete-event simulation library with any open-source animation tool in order to simply visualize a queue system? I know it's possible to use matplotlib, but it rather serves for creating charts, not for building…
FiofanS
  • 309
  • 2
  • 6
  • 13
1
2 3
22 23