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
0
votes
1 answer

Why do I need to `yield env.timeout(0)` to hand over control in simpy?

I'm playing around with simpy for robotics simulations, and i started off with writing a trivial ping-pong game with two rackets called ping and pong. It works as it should only when I add a yield env.timeout(0) to let one player provide an…
Dov Grobgeld
  • 4,783
  • 1
  • 25
  • 36
0
votes
1 answer

fsolve problems with the starting point

I'm using fsolve in order to solve a non linear equation. My problem is that, depending on the starting point the solutions change and I am not sure that the ones that I found are the most reasonable. This is the code import numpy as np import…
user3284140
  • 71
  • 1
  • 1
  • 6
0
votes
1 answer

Python+SimPy hold for process computation time

I want to make simulation where the service time depends on computation complexity of some function. The request arrival should not stop due to the function processing. For testing I use example function that utilizes cpu for some…
lich
  • 290
  • 1
  • 5
  • 10
0
votes
1 answer

Adding GUI in tkinter to a simpy simulation

I have a problem with implementing some GUI into my simpy simulation. The problem is how to add GUI, preferably made in Tkinter, to a simpy project. Wright now I have even problem with creating a window. I think that it's becouse when simulation…
tobi
  • 75
  • 1
  • 7
0
votes
0 answers

Loop issue, creating routing table

i want to create a routing table for my simple network simulator. I need routing tables to be created automatically. I want this table to look this way: [[destinationInterface, nextHop] [destinationInterface, nextHop]] So if router engine gets…
tobi
  • 75
  • 1
  • 7
0
votes
1 answer

How to enable interaction between object in different modules

I am using SimPy, and I try to simulate a network. This is my main module: from SimPy.Simulation import * import node0 import message0 import network0 reload (message0) reload…
tobi
  • 75
  • 1
  • 7
0
votes
1 answer

Simpy events occuring multiple times at the same time

I'm using SimEvent class of Simpy simulator to define some events (say a,b,c). Now I've a process which waits for events a,b and c as shown below. yield waitevent, self, (a, b, c) Once any of these events occur, the process will be reactivated. In…
AIB
  • 5,894
  • 8
  • 30
  • 36
0
votes
1 answer

Python with SimPy on Eclipse installation error (Windows 7)

I have been using the PyDev in eclipse for quite a while with no problem. Today I installed SimPy in my Python and I think it is installed ok, meaning that in idle commands like: >>> from SimPy.Simulation import * >>> now() works fine. Then…
george
  • 1,386
  • 5
  • 22
  • 38
0
votes
1 answer

Simpy priority for breakdown/repair of multiple instances

I have been experimenting with the Bus breakdown example in the Simpy manual and am really struggling to understand why when I create multiple instances of Bus, the last instance seems to get "of sequence" after the first repair. I have modified…
0
votes
1 answer

How to yield an event periodically into schedule without waiting in SimPy?

I am learning SimPy. Currently I need to call a method periodically until the simulation ends. I wrote it like import SimPy.Simulation as Simpy class mod(Simpy.Process): def do(self): print(Simpy.now(), "Do!") yield Simpy.hold,…
Timothy
  • 4,467
  • 5
  • 28
  • 51
-1
votes
1 answer

Traffic simulation using Simpy

I have been working on simpy to design a traffic simulation of a signalized intersection (three approaches). The attached code described the design of the cars driving on a single lane road and arrive at the intersection from one direction only. The…
AAT
  • 3
  • 2
-1
votes
2 answers

Simpy resource unavialbality

I am trying to make resources unavailable for a certain time in simpy. The issue is with timeout I find the resource is still active and serving during the time it should be unavailable. Can anyone help me with this in case you have encountered such…
-1
votes
1 answer

How to Print events and event queues in Simpy?

I want to create a log file to store all the events that occur during the course of my simulation (possibly with timestamp) in Simpy. How can I do this?
-1
votes
1 answer

Simpy '<' not supported between instances of 'Process' and 'int'

I am trying to simulate a simple supply chain environment in Python using Simpy. I have a supplier, a retailer and a warehouse with safety stock. Retailer Places a order, warehouse delivers and if the safety stock goes below threshold, orders goods…
-1
votes
1 answer

Incorrect usage of Simpy resources

I'm currently trying to simulate a store in Discrete Event Simulation using Simply. Due to the fact that my python knowledge is limited I am stuck with a problem. The store repairs broken products for their customers, however, my simulation is not…
Boblo
  • 1
  • 1
1 2 3
22
23