Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Planner gives inaccurate sythesis suggestions #481

Open
thekrampus opened this issue Jan 2, 2022 · 6 comments
Open

Planner gives inaccurate sythesis suggestions #481

thekrampus opened this issue Jan 2, 2022 · 6 comments
Assignees
Labels
affect:logic Changes in Internal Alorithm is required bug Something isn't working expectedly priority:0 Highest priority - critical UE interference/major internal error, causing the app unusable/unstable

Comments

@thekrampus
Copy link

Environment

Mozilla/5.0 (X11; Linux x86_64; rv:95.0) Gecko/20100101 Firefox/95.0

URL

https://penguin-stats.io/planner

Steps to reproduce

Using the following planner configuration:

{"@type":"@penguin-statistics/planner/config","items":[{"id":"30135","have":1},{"id":"30125","have":1},{"id":"30115","have":3,"need":4},{"id":"30073","have":2},{"id":"30084","have":2,"need":6},{"id":"30083","have":3},{"id":"30094","have":12},{"id":"30093","have":64},{"id":"30104","have":1},{"id":"30103","have":2},{"id":"30013","have":2},{"id":"30012","have":4},{"id":"30011","have":2},{"id":"30063","have":52},{"id":"30062","have":69},{"id":"30061","have":35},{"id":"30034","have":9},{"id":"30033","have":13},{"id":"30032","have":35},{"id":"30031","have":87},{"id":"30024","have":9},{"id":"30022","have":18},{"id":"30021","have":49},{"id":"30044","have":1},{"id":"30042","have":10},{"id":"30041","have":6},{"id":"30054","have":1},{"id":"30053","have":43},{"id":"30052","have":61},{"id":"30051","have":68},{"id":"31014","have":4},{"id":"31013","have":43},{"id":"31024","have":3},{"id":"31023","have":61},{"id":"30145","have":1},{"id":"31034","have":5},{"id":"31033","have":17}],"options":{"byProduct":false,"requireExp":false,"requireLmb":false},"excludes":[]}

Select "Calculate" and view the "Syntheses" tab of the results panel.

What is expected?

If I've done my math right, the correct synthesis suggestions should be:

  • Polymerization Preparation x1
  • Manganese Trihydrate x4
  • Orirock Cube x2
  • Orirock Cluster x2
  • Orirock Concentration x1

What is actually happening?

After calculating, the "Syntheses" tab of the calculation result shows the following syntheses:

  • Polymerization Preparation x1
  • Manganese Trihydrate x4
  • Device x1
  • Integrated Device x1
  • Polyketon x1
  • Aketon x1
  • Oriron x1
  • Oriron Cluster x1
  • Oriron Block x1
  • Polyester Pack x1
  • Sugar x1
  • Sugar Pack x1
  • Orirock Cube x2
  • Orirock Cluster x2
  • Orirock Concentration x1
  • Incandescent Alloy Block x1
  • Polymerized Gel x1
  • Crystalline Circuit x1
  • Crystalline Electronic Unit x1

Many of these syntheses are unnecessary. For instance, there's obviously no reason to synthesize Crystalline Electronic Unit as neither the components nor product are involved at all in the needed materials. It looks like the results are suggesting synthesizing x1 of all materials not used in the expected syntheses.

Note that "Consider by-products" is disabled, so the planner is not suggesting the extra syntheses for their byproducts.


I ran into this bug while using the planner normally. I've been able to reproduce it in different browsers on different platforms, so I don't think the problem's on my end.

This bug may be related to #407. However, that ticket was resolved as a non-issue because the described behavior was caused by the synthesis byproduct option. The behavior described here occurs whether synthesis byproducts are enabled or not, and seems to be a genuine bug.

I understand that the ArkPlanner is actually a separate service, but I figured I ought to report it here first through the penguin-stats bug reporter. If I should repost this issue to the ArkPlanner repo, let me know.

@GalvinGao
Copy link
Member

cc @AlvISsReimu

@FlandiaYingman
Copy link
Contributor

A simpler example. Import this and click calculate:

{"@type":"@penguin-statistics/planner/config","items":[{"id":"30115","need":1},{"id":"30084","need":2},{"id":"31033","have":1}],"options":{"byProduct":false,"requireExp":false,"requireLmb":false},"excludes":[]}

And the result shows that we have to synthesize a 31034 Crystalline Circuit 晶体电路, but we don't need it at all.

Because of the item id 31034, I guess the issue relates to #413. However, #413 was fixed recently so we shall wait for the cache to expire.

If tomorrow the issue still remains, I will dig into ArkPlanner further and see what causes the issue

@FlandiaYingman
Copy link
Contributor

The problem seems not relate to the formulas. And I can't understand how ArkPlanner work. Giving up

@whzzt
Copy link

whzzt commented Apr 29, 2022

A correct example that reproduces the case:

{"@type":"@penguin-statistics/planner/config","items":[{"id":"30115","need":1},{"id":"30084","need":4},{"id":"30033","have":5},{"id":"30023","have":4},{"id":"30042","have":10},{"id":"30053","have":3},{"id":"31014","have":4},{"id":"31013","have":5},{"id":"31024","have":3},{"id":"31023","have":5},{"id":"31033","have":5}],"options":{"byProduct":false,"requireExp":false,"requireLmb":false},"excludes":[]}

This problem is due to the linear programming setting because the planner optimizes for minimized total sanity cost. Since synthesizing items cost no sanity, the planner will generate any result that meets the given requirements, allowing redundant synthesis operations.

One possible solution is to add a small cost when synthesizing any item. I am trying to figure out whether there exists a better way to resolve this issue.

@FlandiaYingman
Copy link
Contributor

FlandiaYingman commented Apr 29, 2022

@whzzt Can we compute the equivalent sanity cost from the synthesize LMB cost? Adding it to the synthesize cost shall do the trick.

@whzzt
Copy link

whzzt commented Apr 29, 2022

@whzzt Can we compute the equivalent sanity cost from the synthesize LMB cost? Adding it to the synthesize cost shall do the trick.

It is probably why no such problem exist when requireLmb is turned on.

@GalvinGao GalvinGao added bug Something isn't working expectedly priority:0 Highest priority - critical UE interference/major internal error, causing the app unusable/unstable affect:logic Changes in Internal Alorithm is required labels Apr 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affect:logic Changes in Internal Alorithm is required bug Something isn't working expectedly priority:0 Highest priority - critical UE interference/major internal error, causing the app unusable/unstable
Projects
None yet
Development

No branches or pull requests

5 participants