❔ Using crafting simulator to solve recipes

I have crafting simulator class called CraftingEngine. I am given various recipes and I have to solve them using CraftingEngine. How simulator works: Recipe is added to simulator as target. Then you add crafting actions, which change certain properties of simulator. What properties are important to solving: Progress. Starts at 0. When progress reaches recipe progress target, recipe is considered solved, increased by some actions. Quality. Starts at 0. More quality means recipe is better, can be increased up to the target quality, also increased by some actions. Crafting Points. Starts at max. Most actions cost crafting points. Durability. Starts at max. Most actions reduce durability, but some also restore it, if durability reaches 0 or less with progress not being maxed, recipe fails. I am also given actions that I can use, around 30 of them, with certain conditions. My task: Solving recipes with as few actions as possible. In other words, maximizing Progress and Quality, while minimizing action count. What I tried: Bruteforcing. Testing every possible combination of actions. However, with 15 minimum actions to solve, 30 raised to 15 is a big number. Genetic algorithm. It works, but I think it could be solved using something else. Reducing crafting states count at every step. Generating states from previous iteration and removing all states that have worse properties. Example: you start with one initial state, you generate 30 different states by adding actions, 12 states of those 30 are worse than any other, remove them, generate 30 * 18 states from previous ones, remove all worse states, repeat. With this I can get to about 8 actions deep, before I use up all free memory. What are your thoughts? How could this be solved?
1 Reply
Accord
Accord2y ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server