Commit Graph

46 Commits

Author SHA1 Message Date
TheTaques 2da7ea85af
Add worker/threads flag 2021-06-18 16:27:10 +02:00
Jeremy Saklad c6c04c1025
Count starting limbs in cost of adding joints
Some torsos, notably the Headless Skeleton, come with pre-filled limbs
that must be factored into the calculation.
2021-06-17 11:26:24 -05:00
Jeremy Saklad 244e87e4bf
Change Knotted Humerus value
It has been buffed.
2021-06-17 11:13:48 -05:00
Jeremy Saklad 4025cc2b3f
Adjust values to reflect recent changes
There have been a few nerfs to various overpowered sources and
components.
2021-06-17 08:30:48 -05:00
Jeremy Saklad 5a43e0c9e6
Add ability to specify multiple buyers at once
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.
2021-06-16 17:28:16 -05:00
Jeremy Saklad 9b47e777b4
Fix Exhaustion of Colourful Phantasist
The Colourful Phantasist includes the minimum secondary reward in the
exhaustion formula.
2021-06-16 15:53:10 -05:00
Jeremy Saklad 3032ec320a
Add command-line parameter for occasional buyers
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.
2021-06-16 15:30:48 -05:00
Jeremy Saklad 2dd7643909
Add command-line parameter for time limit
You can now pass an optional time limit to the script, which causes the
solver to return the best solution it has once the duration has elapsed.
2021-06-16 11:32:05 -05:00
Jeremy Saklad 29238cd245
Change minimum of Phantasist's derived exhaustion
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.
2021-06-15 17:48:41 -05:00
Jeremy Saklad 12fa917088
Add hints and assumptions
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.
2021-06-15 17:27:59 -05:00
Jeremy Saklad 3b13e9c25f
Show current best skeleton while calculating
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.
2021-06-15 16:50:28 -05:00
Jeremy Saklad b75d412cb7
Move solution printing to special class
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.
2021-06-15 15:06:54 -05:00
Jeremy Saklad e08b9b07cb
Fix cost of disguising amalgamy
"Disguise the amalgamy of this piece" consumes 25 Jade Fragments, not 1.
2021-06-15 08:30:21 -05:00
Jeremy Saklad 4184468f1d
Add Celestial option of Colourful Phantasist
This buyer scales with the product of implausibility and antiquity.
2021-06-15 07:10:20 -05:00
Jeremy Saklad 70b02586b7
Add Nocturnal option of Colourful Phantasist
This buyer scales with the product of implausibility and menace.
2021-06-15 07:02:49 -05:00
Jeremy Saklad c80b61ba6c
Add Bazaarine option of Colourful Phantasist
This buyer scales with the product of implausibility and amalgamy.
2021-06-15 06:56:05 -05:00
Jeremy Saklad 1c02d9892e
Add The Carpenter's Granddaughter
This buyer produces a Leviathan Frame, and is rather unlikely to ever be
profitable. However, the solver can reduce costs as much as possible.
2021-06-13 22:00:34 -05:00
Jeremy Saklad 36fa9c3e2e
Fix cost of Ribcage with Eight Spines
It was missing a Skeleton with Seven Necks.
2021-06-13 21:05:04 -05:00
Jeremy Saklad 3c210cbaba
Add CLI
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.
2021-06-13 19:40:11 -05:00
Jeremy Saklad d571167742
Make buyers part of model
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.
2021-06-13 17:37:39 -05:00
Jeremy Saklad 52a509bd19
Add Action values for buyers
This will allow buyers to be variable rather than fixed, and increase
the orthogonality of the code.
2021-06-13 14:58:51 -05:00
Jeremy Saklad 06929bd7b2
Add Embellishment enumeration
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.
2021-06-13 14:36:53 -05:00
Jeremy Saklad 0b7997ede4
Centralize value remainder declaration
Many buyers use a value remainder to round revenue down. Declaring it
outside of buyer-specific logic simplifies almost all of them.
2021-06-13 14:36:53 -05:00
Jeremy Saklad 0b3911a4e0
Centralize exhaustion calculation
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.
2021-06-13 14:36:53 -05:00
Jeremy Saklad 1b4e4b5f08
Add Penny to Cost enumeration
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.
2021-06-13 14:36:53 -05:00
Jeremy Saklad fb4681d93e
Rename Value enumeration to Cost
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.
2021-06-13 14:36:53 -05:00
Jeremy Saklad abd796f64d
Remove data model
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.
2021-06-13 14:36:28 -05:00
Jeremy Saklad 04b766a619
Move constants out of data model
The data model serves no clear purpose, and will be removed shortly.
2021-06-13 14:36:13 -05:00
Jeremy Saklad 82e9584f6f
Clean up Declaration
Declaration members are now sorted lexicographically, and broken across
multiple lines.
2021-06-13 14:36:13 -05:00
Jeremy Saklad 354ee327a3
Move adjustments to Adjustment enumeration
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.
2021-06-13 14:36:10 -05:00
Jeremy Saklad 7c0f4bb3f5
Change Mammoth Ribcage cost to Balmoral
Even discounting ancillary benefits, acquiring a Mammoth Ribcage through Balmoral Woods is substantially cheaper than producing one from scratch with most action values.
2021-06-13 14:35:52 -05:00
Jeremy Saklad 1204909151
Move tail values to Value
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.
2021-06-13 14:35:52 -05:00
Jeremy Saklad 276ead2fbb
Move tails to Appendage enumeration
This continues the transition away from a single action list.
2021-06-13 14:35:52 -05:00
Jeremy Saklad c5ab0bc4d8
Move joint-adding to Appendage
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.
2021-06-13 14:35:52 -05:00
Jeremy Saklad 99afbb0534
Move legs to Appendage enumeration
This continues the transition away from a single action list.
2021-06-13 14:35:52 -05:00
Jeremy Saklad 0a99b5e11b
Move wing values to Value
The cost of applying each wing has been broken down and moved to value.

Appendage has once again been cleaned up and sorted lexicographically.
2021-06-13 14:35:51 -05:00
Jeremy Saklad 7fed5e2e79
Move wings to Appendage enumeration
This continues the work on Appendage.
2021-06-13 14:35:51 -05:00
Jeremy Saklad 333f08efc4
Move arm values to Value enumeration
The cost of applying each arm has been broken down and moved to Value.

Arms have been cleaned up and ordered lexicographically.
2021-06-13 14:35:51 -05:00
Jeremy Saklad 614598130a
Move arms to Appendage enumeration
This continues the transition away from a single action list.

Because limbs and tails are not mechanically distinct, they are not going to get their own enumerations.

Due to the number of members ultimately going in this enumeration, they will be moved piecemeal.

The members of Appendage will be temporarily added to the action list like the other enumerations.
2021-06-13 14:35:48 -05:00
Jeremy Saklad 245248f320
Move Skull values to Value enumeration
The cost of applying each skull has been broken down and moved to Value.

Skull has been cleaned up and ordered lexicographically.
2021-06-13 14:35:36 -05:00
Jeremy Saklad f1e2f75cf6
Move skull actions to Skull enumeration
This continues the transition away from a monolithic action list.

Like Torso, the members of Skull are being added to the action list as a temporary measure.

Torso.LICENTIATE_SKELETON has been renamed Torso.VICTIM_SKELETON to better align with the corresponding Skull.
2021-06-13 14:35:31 -05:00
Jeremy Saklad 479a87fa14
Move Torso values to Value enumeration
The cost of each torso quality is now abstracted into the Value enumeration.
Each step necessary is broken down until a penny value is assigned.
This makes it much easier to understand and potentially customize later.

The Torso enumeration now has its members broken across multiple lines, for ease of reading.

The sources for Thorned Ribcages and Leviathan Frames were changed.
2021-06-13 14:35:07 -05:00
Jeremy Saklad 7822e8e08e
Add Value enumeration
This enumeration will be used to rationalize and centralize costs across the script.

ACTION_VALUE and SURVEY_VALUE have been moved into this enumeration, and more will be added.
2021-06-13 14:35:07 -05:00
Jeremy Saklad 050d326bc6
Move torso actions to Torso enumeration
For the sake of readability and organization, all of the actions are going to be moved into enumerations instead of being lumped into a massive list literal.
Until every action is transitioned, enumerations will simply be prepended onto the current list.

Some of the torso comments have been cleaned up or expanded.
2021-06-13 14:34:59 -05:00
Jeremy Saklad 14c0d4bb04
Remove Torso subclass
The Torso subclass is an unnecessary complication that may get in the way of future overhauls, so it has been removed.

Action now has the torso_style property that Torso added, defaulting to None.

Logic based on whether an Action was a Torso now checks if torso_style has a value.
2021-06-08 17:49:45 -05:00
Jeremy Saklad 62c99e8211
Initial commit 2021-06-08 17:28:15 -05:00