Personal roboport parameter update
Posted: Wed Sep 14, 2016 4:49 am
When using the LuaEquipmentGrid take() and put() methods with personal roboports the parameters of the mobile logistic network don't update. For example, if you take() a roboport with a radius of 15 out and put() one with a radius of 10 to replace it the range stays the same. Robots still work at the previous range, the green zone is rendered at the same size, and the equipment grid GUI still shows the previous values. If you replace a roboport with one that has a lower robot_limit the GUI in the equipment grid does update, but the robots are still happily swarming around at the previous limit.
I first considered filing this as a bug but I think that would be a mistake. In my particular use case I want to replace the normal roboport with one that has a lower range. I do that by take()-ing the old one out and put()-ing the replacement in at the same position. If current behavior were to change so that each of the two calls would re-evaluate the network's parameters it would run the risk of orphaning launched robots which would be very annoying.
So instead how about having a update_parameters() function that recalculates the equipment grid properties and adjusts the network, but only when requested. Ideally it would make robots outside the new construction range abort their task and find a new one withing the new range, or dock if none can be found. I'm not entirely sure whether this should be part of the entity, grid, network or logistic cell though.
I first considered filing this as a bug but I think that would be a mistake. In my particular use case I want to replace the normal roboport with one that has a lower range. I do that by take()-ing the old one out and put()-ing the replacement in at the same position. If current behavior were to change so that each of the two calls would re-evaluate the network's parameters it would run the risk of orphaning launched robots which would be very annoying.
So instead how about having a update_parameters() function that recalculates the equipment grid properties and adjusts the network, but only when requested. Ideally it would make robots outside the new construction range abort their task and find a new one withing the new range, or dock if none can be found. I'm not entirely sure whether this should be part of the entity, grid, network or logistic cell though.