Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I am building a strategy game where units can interact with each other. As input

ID: 651768 • Letter: I

Question

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 action
receiving unit(optional) - the unit on witch the action is applied
supported 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 action

Rules:

Units can only perform one action in a time
Units may have to perform more than one action

The 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)

Explanation / Answer

Your set of rules is self-conflicting. You require

Same unit cannot perform two actions in parallel

but also

When unit perform attack, the interacting unit must perform take damage [...] during the attack-action time of the performing unit.

and

Multiple units can attack single unit at once

In other words, you require that multiple take damage actions be performed simultaneously while demanding that that may not happen.