Python Forum
Unexpected simpy simulation output
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unexpected simpy simulation output
#2
I have had some experience with the SimPy framework. It seems that capacity (allowed queue length) of Store200 is greater 1. What parameters did you use to run the model?

I slightly restructured your code,

    ....
    arrive = env.now
    print('%7.4f %s: Entered pharmacy' % (env.now, name))
    
    print('%7.4f %s: Started to wait... ' % (env.now, name))
    with counter.request() as req:
            results = yield req
            print('%7.4f %s: The resource is free, lets use it... ' % (env.now, name))
 
            wait = env.now - arrive
 
            # We got to the str1_counter
            print('%7.4f %s: Waited in greet queue for %6.3f' % (env.now, name, wait))
 
            tib =  time_in_input_stn
            yield env.timeout(tib)
            print('%7.4f %s: Greet process completed ' % (env.now, name))

     .....
and ran it with unity story capacities and got the following output:

Output:
How many stores do you want to choose1 Enter the store & capacity1,1 0.0000 Store1Customer0: Entered pharmacy 0.0000 Store1Customer0: Started to wait... 0.0000 Store1Customer0: The resource is free, lets use it... 0.0000 Store1Customer0: Waited in greet queue for 0.000 0.5100 Store1Customer1: Entered pharmacy 0.5100 Store1Customer1: Started to wait... 0.5227 Store1Customer2: Entered pharmacy 0.5227 Store1Customer2: Started to wait... 0.6835 Store1Customer3: Entered pharmacy 0.6835 Store1Customer3: Started to wait... 0.8098 Store1Customer4: Entered pharmacy 0.8098 Store1Customer4: Started to wait... 1.0000 Store1Customer0: Greet process completed 1.0000 Store1Customer0: Waited in digital queue for 0.000 1.0000 Store1Customer1: The resource is free, lets use it... 1.0000 Store1Customer1: Waited in greet queue for 0.490 2.0000 Store1Customer1: Greet process completed 2.0000 Store1Customer1: Waited in digital queue for 0.000 2.0000 Store1Customer2: The resource is free, lets use it... 2.0000 Store1Customer2: Waited in greet queue for 1.477 3.0000 Store1Customer2: Greet process completed 3.0000 Store1Customer3: The resource is free, lets use it... 3.0000 Store1Customer3: Waited in greet queue for 2.316 4.0000 Store1Customer3: Greet process completed 4.0000 Store1Customer4: The resource is free, lets use it... 4.0000 Store1Customer4: Waited in greet queue for 3.190 5.0000 Store1Customer4: Greet process completed 6.0000 Store1Customer0: Digital process done 6.0000 Store1Customer2: Waited in digital queue for 3.000 7.0000 Store1Customer1: Digital process done 7.0000 Store1Customer3: Waited in digital queue for 3.000 11.0000 Store1Customer2: Digital process done 11.0000 Store1Customer4: Waited in digital queue for 6.000 12.0000 Store1Customer3: Digital process done 16.0000 Store1Customer4: Digital process done
It seems, that everything works fine...
Reply


Messages In This Thread
Unexpected simpy simulation output - by bakas - Sep-05-2018, 06:00 AM
RE: Unexpected simpy simulation output - by scidam - Sep-07-2018, 01:14 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Unexpected output Starter 2 493 Nov-22-2023, 12:08 AM
Last Post: Starter
  Unexpected Output - Python Dataframes: Filtering based on Overlapping Dates Xensor 5 722 Nov-15-2023, 06:54 PM
Last Post: deanhystad
  Unexpected output while using random.randint with def terickson2367 1 519 Oct-24-2023, 05:56 AM
Last Post: buran
  Unexpected output from df.loc when indexing by label idratherbecoding 6 1,209 Apr-19-2023, 12:11 AM
Last Post: deanhystad
  unexpected output asyrafcc99 0 1,510 Oct-24-2020, 02:40 PM
Last Post: asyrafcc99
  Unexpected output: symbols for derivative not being displayed saucerdesigner 0 2,061 Jun-22-2020, 10:06 PM
Last Post: saucerdesigner
  Unexpected output palladium 4 2,761 Jan-11-2020, 03:26 PM
Last Post: palladium
  Unexpected output: if statement CabbageMan 1 1,771 Sep-04-2019, 04:12 PM
Last Post: ThomasL
  Unexpected Output using classes and inheritance langley 2 1,958 Jul-04-2019, 09:33 AM
Last Post: langley
  float multiplication - unexpected output inesk 3 3,358 Dec-11-2018, 10:59 AM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020