Hi Chelsea,
> Am 2016-08-19 um 19:12 schrieb Chelsea Kolb <
chelsea...@gmail.com>:
>
> Is there a good way to divide a process into subprocesses?
yes, there are two different ways to have sub generators/processes:
import simpy
def sub(env):
yield env.timeout(1)
def master(env):
# Variant a: Just yield from sub(). It is uses like
# a normal generator and no real sub process is started:
yield from sub(env)
# Start an actual sub process. This way, you start it and
# wait until it terminates:
yield env.process(sub(env))
# You can also do stuff like this if you start an actual
# sub process:
child = env.process(sub(env))
yield env.timeout(0.5)
yield child
env = simpy.Environment()
env.process(master(env))
env.run()
Cheers,
Stefan
>
> For example, when a piece of equipment breaks down and requires 3 different parts for repair, I'd like to diagnose the equipment failure as a process, track each part individually as it is ordered, shipped, and arrives at the shop, and then again track the equipment repair as a process once all of the parts have arrived. I want a queueing system for each part in the subprocess and then a maintenance queue for the final repair. I'm having trouble understanding how these subprocesses can be queued independently and then brought back together for the final maintenance. Do you have any suggestions?
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups "python-simpy" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
python-simpy...@googlegroups.com.
> To post to this group, send email to
python...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/python-simpy/46087158-e248-4354-946f-22f6884149a6%40googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.