Commit 44dd038d authored by Markus Klinik's avatar Markus Klinik
Browse files

constraints and invalid assignments

parent 3cc01e8a
......@@ -94,9 +94,27 @@ Alexeev discards the old population and continues with the new one.
We changed this so that the old and new populations are combined, sorted according to the fitness function, and then the best chromosomes are taken to be the new generation.
This way the algorithm preserves the best individuals found so far.
\paragraph{Constraints and invalid assignments}
There are two kinds of constraints that every assignment must satisfy.
First, no resource can be assigned simultaneously to multiple capability requirements of the same task.
For example, if some task requires an Operator and a Medic, and Alice has both capabilities, she can not be assigned to both.
Second, affinity constraints require the same resource to be assigned to several resource requirements of different tasks.
The second kind of constraint is always satisfied by the way we implement resource frames.
The algorithm selects one resource for the requirement of the frame, which applies to all tasks in the frame.
The first kind of constraint can be violated, and must be checked by the fitness function.
Our fitness function therefore returns either a valid score or an invalid score.
A valid score is the weighted product of all qualities, while an invalid score is the number of duplicate assignments.
Individuals in a population are ranked as follows.
Invalid scores are always worse than valid scores.
Valid scores are ranked according to their weighted product, where more-is-better.
Invalid scores are ranked according to the number of duplicate assignments, where less-is-better.
In this way, the algorithm can explore invalid regions of the search space, while being incentivized to avoid them in favour of valid regions.
Fitness function: compare two individuals by using the smart weighted product.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment