Solved: Car.py in Salabim causes infinite loop on python 3.8

25 views Asked by At

I'm following the manual of salabim 23.2.0. My Python version is 3.8.2.

When I'm running the first example. i.e., Car.py:

# Car.py
import salabim as sim

class Car(sim.Component):
    def process(self):
        while True:
            self.hold(1)


env = sim.Environment(trace=True)
Car()
env.run(till=5)

This program will running infinitely. Can anyone kindly help me how to fix the program? Thanks in advance.

This example is supposed to stop after five loops as explained in the salabim manual. I tried other examples and have the same results, i.e., infinite loops. The infinite loop is caused by the statement "while True:" statement in Car.py. However, when I debugged into the self.hold(1), I'm not able to follow the codes..

Solution: I got reply from Ruud van der Ham:). He told me to install the latest version (23.3.1) via "pip install salabim --upgrade"

0

There are 0 answers