Get rid of containsKey()

Replace with the get-and-optional-put pattern, which is much more
efficient.
Prevent excessive iteration

This will come in handy for those instances where there are thousands of
machines.
Fix the precision loss in FixedPointArithmetic
TaskAssignmentDifficultyComparator: never equals
Smarter loop prevents the need for constant Period.get()
Get rid of a defensive check
Properly size collections to avoid resizing as much as possible
Reduce the number of multiplications as they are potentially costly