Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,24 @@
|
|||
declare
|
||||
proc {Knapsack Sol}
|
||||
solution(panacea:P = {FD.decl}
|
||||
ichor: I = {FD.decl}
|
||||
gold: G = {FD.decl} ) = Sol
|
||||
in
|
||||
{Show 0#Sol}
|
||||
3 * P + 2 * I + 20 * G =<: 250 {Show 1#Sol}
|
||||
25 * P + 15 * I + 2 * G =<: 250 {Show 2#Sol}
|
||||
{FD.distribute naive Sol} {Show d#Sol}
|
||||
end
|
||||
|
||||
fun {Value solution(panacea:P ichor:I gold:G)}
|
||||
3000 * P + 1800 * I + 2500 * G
|
||||
end
|
||||
|
||||
{System.showInfo "Search:"}
|
||||
[Best] = {SearchBest Knapsack proc {$ Old New}
|
||||
{Value Old} <: {Value New}
|
||||
end}
|
||||
in
|
||||
{System.showInfo "\nResult:"}
|
||||
{Show Best}
|
||||
{System.showInfo "total value: "#{Value Best}}
|
||||
Loading…
Add table
Add a link
Reference in a new issue