How To Use Yield Dynamically That Doesnt Effect The Whole Environment
I am new to python and I want to ask something in detail about simpy environment. so let's say it like this I have 2 cars and each car has to perform same function at different time but the problem is, when I used yield env.timeout(something) it change the whole environment time but in actual I want to do it separately. For example if car A is moving from point 1 at time t1 and doing some work at time t2 and after that the car 2 is moving and doing samework at time t3 and t4 but I want to do this like, let say the car A is moving from point 1 at time t1 and doing somework at time t2 in the same case the I want to move car 2 at time t1.5 even the car 1 is on its way at time t1.5. both of them should not be in depending mood. How to synchronize that? If someone has experience please help. thank you
Answer
you can define Car A and Car B as two difference environment process. Do not put CarA and CarB in the same function
env.process(CarA(env))
env.process(CarB(env))
Related Questions
- → What are the pluses/minuses of different ways to configure GPIOs on the Beaglebone Black?
- → Django, code inside <script> tag doesn't work in a template
- → React - Django webpack config with dynamic 'output'
- → GAE Python app - Does URL matter for SEO?
- → Put a Rendered Django Template in Json along with some other items
- → session disappears when request is sent from fetch
- → Python Shopify API output formatted datetime string in django template
- → Can't turn off Javascript using Selenium
- → WebDriver click() vs JavaScript click()
- → Shopify app: adding a new shipping address via webhook
- → Shopify + Python library: how to create new shipping address
- → shopify python api: how do add new assets to published theme?
- → Access 'HTTP_X_SHOPIFY_SHOP_API_CALL_LIMIT' with Python Shopify Module