I am building a strategy game where units can interact with each other.As input I am getting a list of actions. I need to output a scheduler, that will tell when to start each action. The goal is to find the shortest time combination of all the actions.Action is defined as interaction between two users or user with him self, it build from 4 parts: performing unit - the unit that performs the actionreceiving unit(optional) - the unit on witch the action is appliedsupported actions - A list of actions that the receiving unit can perform while applying this action on him.action time - how long does it takes to execute the actionRules:Units can only perform one action in a timeUnits may have to perform more than one actionThe best solution will be: Is to run all those actions in parallel. There are two things that stops me from doing it.If more than one action have the same performing unit, they cannot start simultaneously as units can perform only one action in a time.(Rull 1)The other problem is actions with receiving unit. I need to make sure that the receiving unit is currently performing one of the supported actions(defined in action part 4), if it's not, this actions cannot be started.In case of actions without receiving unit, they can all be started simultaneously. How ever I need to make sure that I am not left with action that have a receiving unit, that cannot be started as the receiving unit already performed all his actions.(So supported action will never be started)
Build a scheduler, to simulate parallel game flow
concurrency