A docstring has been added describing the module's purpose.
__all__ has been added. It is limited to the declarations needed to use
Solve().
The author's name has been added.
Unlike comments, docstrings support runtime introspection and other
features.
The docstrings are arguably a bit sparse, but this is sufficient for the
time being.
Users can now specify multiple buyers, allowing the solver to figure out
the best skeleton that could be sold to any of them. This could be
useful for buyers that share a payout.
Some buyers are only available based on a world quality. The solver now
skips buyers if they are not available. This is specified using a new
parameter, which is mutually-exclusive with specifying a specific
buyer.
If no buyer is specified, this world quality must be specified instead to tell
the solver who is around.
If the minimum is 0, then that value will never be allowed to be
negative. Since it is calculated even when that is not the selected
buyer, that prevents overcorrections that should be permitted.
The solver now starts by trying to solve without adding joints or declaring
skeletons chimeras.
Desired buyers are now set as an assumption rather than a linear
expression.
So long as verbose mode is not active, the script will now display the
current skeleton as it tries to search for more solutions.
This feature uses the curses module to create an alternate screen, so
intermediate solutions are not sent to standard output.
This class has the advantage of being usable as a solution printer,
which can print each solution as they are generated. This tends to be
extremely verbose, but may prove useful for debugging.
Instead of using hardcoded parameters, this script now uses argparse to
offer a command-line interface.
This includes help text, short and long option specifiers, and control
over everything from verbosity to the current world qualities.
Occasional Buyer hasn't been implemented yet, but will eventually be a
required parameter.
Buyers are now part of the model, rather than being fixed. This means
that the model can choose from among all buyers and determine the most
profitable option.
Accomplishing this meant replacing the if-else control flow with a large
quantity of half-reified constraints.
These actions are taken after a declaration is made, but before the
skeleton is sold.
Since these actions offer a way of reducing implausibility,
difficulty level has been tweaked to avoid allow lowering it past zero.
Exhaustion from actions is now calculated without regard to the buyer.
Exhaustion from the buyer is stored in an intermediary "Added
Exhaustion" variable, which is added to produce the final exhaustion
value.
This change substantially reduces the complexity of buyer-specific
logic, which will help future improvements.
For the sake of clarity, members of Cost now have terminal values iff
they are assigned an arbitrary cost rather than an actual method of
acquisition.
The primary effect of this change is that items that are purchased from
a shop are given a value in terms of the currency used, rather than a
numeric literal. This makes it much easier to tell where refinements to
the model may be necessary.
This change better reflects the meaning of this enumeration: the cost of
acquiring something is usually greater than the value that can be
extracted from it.
Rather than having a single action list, actions are now added to the
model enumeration-by-enumeration. This allows for more flexibility and
clarity when introducing exceptions to the norm.
Skipping tails is now modelled correctly: it can only be done once, and
doing so removes all remaining tails. As far as the model is concerned,
this means that not all tails need to be filled if tails have been
skipped.
Adjustments made to a skeleton after all parts have been added are now
in a distinct enumeration.
The action list is now entirely composed of enumerations, so it shall be
eliminated entirely soon.
Even discounting ancillary benefits, acquiring a Mammoth Ribcage through Balmoral Woods is substantially cheaper than producing one from scratch with most action values.
The cost of applying each tail has been broken down and moved to value.
Skipping tails remains slightly flawed, and will be cleaned up in the
future.
Appendage has once again been cleaned up and sorted lexicographically.
Removing and skipping tails remain at the bottom, as they must be done
after adding tails.
Due to integer overflow issues, both Value.EYELESS_SKULL and
Value.OBSIDIAN_TAIL now have a value of cp_model.INT32_MAX/2. If this
issue recurs, dividing by successively larger powers of 2 may be
necessary.
Adding joints is allowed at the same time adding appendages is, so it belongs in the Appendage enumeration.
In addition to having its constant cost expressed in terms of Value members, adding joints now expresses
the dynamic cost in terms of Warm Amber.
This particular action should be kept above other actions in the enumeration, as it must be performed
before the extra appendages can be added.