A Solution object contains a a mutation object, a combinatorial object
(CO) - permutation, subset, or partition - and its costs, computed by the
specified objective functions. Each combinatorial object has a reference
count which is manipulated by the Solution class to know when to copy,
commit, and discard the combinatorial object.
Since the system is time sensitive, generation of Solution objects are
stopped by a monitoring object when the system meets a time constraint
(e.g. reporting constraint, or deadline constraint). If the system meets
the reporting constraint, the search that requests a solution to be generated
must satisfy this constraint by reporting and then ask the monitoring object
to lift the block. To ease a specific search (e.g. simulated annealing) to
deal with these activities, they are handled in a BasicSearch
class from which a specific search is derived. If the system meets the
deadline constraint, it will stop.
The Solution class generate solutions in three distinct manners, which account for all the need of a typical local-search heuristic. Assuming time constraints have been satisfied,
Deletion of a Solution object occurs only if the deleted object
is the sole possessor of the CO. Otherwise, the CO's reference count is
decremented.
In Assignment of a Solution object, the object to be assigned to decrements its reference count and delete the CO if its no longer being referred to, before incrementing and pointing to the new referenced CO.