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
1
vote
1 answer

Python + simPy: name 'move' is not defined

I am making a simulation using python 2.6 + Simpy, about the subway system. here's my code: import sys import random from math import* from math import ceil, log from random import* from random import random, uniform, seed, expovariate from SimPy…
franvergara66
  • 10,524
  • 20
  • 59
  • 101
1
vote
2 answers

Python, SimPy: Using yield inside functions

Helo, I'm building a relatively complex Discrete Event Simulation Model in SimPy. When I try to put my yield statements inside functions, my program doesn't seem to work. Below shows an example. import SimPy.SimulationTrace as Sim import random ##…
lamba
  • 1,581
  • 5
  • 18
  • 29
1
vote
1 answer

In a SimPy simulation, how can I simulate a bus waiting to be entirely filled?

I'm trying to use SimPy to simulate a bus that stops periodically in a station and then waits until it gets filled by N passengers (assume that the bus is empty each time it arrives at the station), being N the total amount of spots that the bus…
Vile
  • 11
  • 2
1
vote
2 answers

Simulating factory manufacture with simpy by requesting multiple resources at the same time, but running for different time

I was trying to simulate a factory manufacturing different products with different machines with simpy. For each product, we will need to allocate different machines for production. For example, the first product will ask for machines 1, 2, 5…
Snoopy
  • 138
  • 6
1
vote
3 answers

Get all processes in simpy Environment

If I have a simpy.Process that creates nested processes, is there a way to get a list of all the active/alive processes from it's simpy.Environment? Basically I've created a tree of simpy processes and at some point I want to interrupt all of the…
gameveloster
  • 901
  • 1
  • 6
  • 18
1
vote
3 answers

Creating a process to process all item in order fulfillment simulation

I asked a different question about this simpy simulation model before, and Michael answered it and helped me tremendously. Now I have a new issue with this model, and I hope you guys can help me out. You can find that question here Let me first…
1
vote
1 answer

Simulation of servers processing batches with interrupting set-up/switch-on times

I would like to create a system with servers that need time to set up before being ready to serve. The system starts to set up whenever enough M (2, 3,...) customers are in the queue. If the number of customers in the system reaches the maximum…
Julian
  • 15
  • 6
1
vote
1 answer

SimPy: In every step, run a specific process after all the other processes has finished

I am new to SimPy and need help to figure out how to do this: There are multiple foo processes running and a monitor process. At every time step, is there a way to ensure that the monitor process runs only after the other foo processes have finished…
gameveloster
  • 901
  • 1
  • 6
  • 18
1
vote
1 answer

Simpy: Callcenter simulation - inactive call timeout

currently I am working on a more or less complex callcenter simulation. I am quite new to Simpy and have a problem with timing out calls if no agent could answer them. In my simulation I generate calls in 4 different queues. Each of them should have…
steMy
  • 23
  • 4
1
vote
0 answers

How to get the item name and not its address when requesting with a "condition event" from a Simpy-Store

A Simpy-Store is filled with elements {0}...{9} car_Fleet = simpy.Store(env, capacity=10) i = 0 for i in range(10): car_Fleet.put({i}) i += 1 When requesting an item from that store car_id = yield car_Fleet.get() print(car_id) the…
MacUserXL
  • 35
  • 5
1
vote
1 answer

SimPy Simulation of RentalService stops before all yield statements of all processes are fulfilled

Multiple identical Items can be "rented" from a SimPy store element. The availability of Items is limited to a number lower than the actual demand. By using yield statements other processes should wait until their demand can be met. The simulation…
MacUserXL
  • 35
  • 5
1
vote
1 answer

simpy store capacity left

I am trying to find out how can I know how many items are currently stored in a buffer using Simpy. In my situation there is a machine that produces items and next they are stored in a buffer with limited capacity (2). So if the buffer is full, the…
JK7
  • 125
  • 1
  • 1
  • 8
1
vote
1 answer

Simpy: How to implement a resource that handles multiple events at once

I am simulating people movements and their elevator usage. An elevator can take up multiple persons before moving to another floor. The default process has a capacity parameter, however, these indicate the number of processes and not the number of…
user7375116
  • 201
  • 1
  • 7
1
vote
1 answer

SciPy minimization of a SimPy simulation says 'Inequality constraints incompatible' when using only an eq constraint

So I'm trying to maximize the output of a queue chain, and after building the whole simulation I applied the "- minimization" approach. The code does run, but when I check the results, all I see is fun: -76.0 jac: array([2.68435456e+08,…
user18368547
1
vote
1 answer

Simpy fairshare proportional scheduling

I am using SimPy to simulate a compute cluster. I want to implement a fair-share/proportional scheduling logic in Simpy, wherein the resource slots are proportionally distributed across remaining tasks based on their priority. E.g. if we submit two…
Mehtab Pathan
  • 443
  • 4
  • 15