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
2
votes
3 answers

FilterStore queue

I have a FilterStore and during my simulation there is a queue for the FilterStore.Get event at some times. Now I have two questions: Is there a way to see the actual elements in the queue, not just the object number? With FilterStore.get_queue I…
Ana
  • 51
  • 5
2
votes
1 answer

Simpy: Requesting multiple (nonspecific) resources and order of requests

I'm working on a queuing simulation model in python 2 that has jobs coming into the system and requesting multiple resources. Each job that arrives asks for different amounts of resources (and not a specific resource!) and uses the resources for a…
s.im
  • 21
  • 2
2
votes
2 answers

simpy how to run a simulation multiple times

I have a basic simpy question. I have created a basic simulation and now want to run it many times to get a distribution of possible values. Is there a more efficient way to do this than to run the script multiple times? Is there a way to reset the…
Allen Wang
  • 2,426
  • 2
  • 24
  • 48
2
votes
1 answer

Interrupt conditional event in simpy

simpy newbie here. I just started to make Speaker-Moderator simulation with simpy. Here is my code import simpy def speaker(env): try: print("Speaker start to talk at: {}".format(env.now)) speak_time = 40 print ("Speaker…
yusri
  • 21
  • 4
2
votes
0 answers

python simpy memory usage with large numbers of objects/processes

I am using simpy to create a DES with a very large numbers of objects (many millions). I am running into memory issues and have being trying to figure out how to address this. It is possible to work out which objects will not undergo anymore…
Pete
  • 767
  • 3
  • 9
  • 16
2
votes
3 answers

Which books are used today to learn discrete-event simulation?

I just got enrolled in a program that starts me in researches about new Networks Protocols, and my first assignment is to learn about Discrete-Event Simulation. It was recommended 2 books: Simulating Computer Systems: Techniques and Tools by Myron…
Loic1472
  • 33
  • 1
  • 3
2
votes
1 answer

Event Queue in SimPy

I'm coming from a SystemC world and I am trying to code something simple in Python. I wonder if Python has something similar to peq_with_get() (from SystemC) which is basically a queue that preserves all the triggers made to an event. I developed…
Amir
  • 421
  • 1
  • 4
  • 14
2
votes
1 answer

Simpy - accessing multiple resources

I am starting to learn SimPy DES framework.I want to implement a simulation in which requests arrive at different times to the server. There are different types of requests, each one of them loads server with specific memory/cpu load. So, for…
2
votes
1 answer

Python-simpy bitwise or

Now I learn the simpy library of python. Could you explain me why bitwise-or is used in this example. Why we can't use simple or statement. results = yield req | env.timeout(patience)
Kenenbek Arzymatov
  • 8,439
  • 19
  • 58
  • 109
2
votes
2 answers

Linking Simpy simulation time to Python Calendar for week day specific actions

I want to build a simulation model of a production network with SimPy comprising the following features with regard to time: Plants work from Monday to Friday (with two shifts of 8 hours) Heavy trucks drive on all days of the week except…
mondano
  • 827
  • 10
  • 29
2
votes
2 answers

Simpy; how to incorporate an unknown amount of interrupts

I am using python and simpy for a simulation. In the simulation one instance (interrupted) can be interrupted by another (interruptor). I use nested try except statements for each interruption. Nested try except statements work if I know the maximum…
nkz
  • 165
  • 9
2
votes
1 answer

How do I model tasks precedence?

I'm trying to simulate a bunch of tasks that all together belong to the same generic project. Tasks have duration and precedence (represented by a list of tasks that have to be done before the current task). For example: /--->A --->B\ Start…
pazitos10
  • 1,641
  • 16
  • 25
2
votes
1 answer

Need help for SimPy Simulation on Availability

I have been having problems with the simulation I have built and I am not sure how I can go about solving them. The idea of this simulation is as follows: There are a total of 10 machines in the system. When the simulation starts, 6 of the machines…
Craig
  • 43
  • 4
2
votes
2 answers

Simpy 3.0.4, setting resource priority

I am having trouble with resource priority in simpy. Consider the following code: import simpy env = simpy.Environment() res = simpy.PriorityResource(env, capacity = 1) def go(id): with res.request(priority = id) as req: yield req …
Shafaet
  • 425
  • 1
  • 6
  • 17
2
votes
2 answers

python (SimPy) generate random numbers that follow the erlang distribution

I am using Python (SimPy package mostly, but it is irrelevant to the question I think), modeling some systems and running simulations. For this purpose I need to produce random numbers that follow distributions. I have done alright so far with some…
george
  • 1,386
  • 5
  • 22
  • 38
1 2
3
22 23