package Ġit . uni bo . ai . did att ica . comp etition . tab lut . test Ċ Ċ import Ġa ima . core . search . framework . problem . Goal Test Ċ import Ġa ima . core . search . local . Gen etic Algorithm For Numbers Ċ import Ġa ima . core . search . local . Individual Ċ import Ġit . uni bo . ai . did att ica . comp etition . tab lut . aic lient . Tab lut Iter ative Deep ening Client Ċ import Ġit . uni bo . ai . did att ica . comp etition . tab lut . aic lient . algorithms . he ur istics .* Ċ import Ġit . uni bo . ai . did att ica . comp etition . tab lut . client . Tab lut Client Ċ import Ġit . uni bo . ai . did att ica . comp etition . tab lut . simulation . Simulation Function Ċ import Ġit . uni bo . ai . did att ica . comp etition . tab lut . util . to File Ċ import Ġkotlin . math . floor Ċ import Ġkotlin . math . log 2 Ċ Ċ const Ġval ĠMAX _ TIME _ SECONDS : ĠInt Ġ= Ġ 2 4 Ġ* Ġ 6 0 Ġ* Ġ 6 0 Ġ// Ġ 1 Ġday Ċ val ĠUN RE ACH ABLE _ GO AL : ĠGoal Test Ġ= ĠGoal Test Ġ{ Ġfalse Ġ} Ċ Ċ fun Ġmain () Ġ{ ĊĠĠĠ Ġval Ġinitial Population : ĠList < Individual < Double >> Ġ= Ġ( 1 .. 1 5 ). filter Ġ{ ĊĠĠĠĠĠĠĠ Ġlog 2 ( it . toDouble ()). let Ġ{ Ġexp Ġ-> Ġexp Ġ!= Ġfloor ( exp ) Ġ} Ġ// ĠExclude Ġpowers Ġof Ġ 2 ĊĠĠĠ Ġ}. map Ġ{ Ġnumber Ġ-> ĊĠĠĠĠĠĠĠ Ġgenerate Sequence ( number ) Ġ{ Ġit Ġ/ Ġ 2 Ġ}. map Ġ{ Ġweight Ġ-> Ġweight Ġ% Ġ 2 Ġ}. take ( 4 ). toList () Ġ// ĠBinary Ġrepresentation ĊĠĠĠ Ġ}. map Ġ{ Ġweights Ġ-> ĠGen etic He uristic ( weights [ 0 ], Ġweights [ 1 ], Ġweights [ 2 ], Ġweights [ 3 ]) Ġ} ĊĠĠĠ Ġ. map Ġ{ Ġit . individual Ġ} ĊĊĠĠĠ Ġval Ġwhite Weights Ġ= Ġgen et ically Computed Weights ( ĊĠĠĠĠĠĠĠ Ġinitial Population , ĊĠĠĠĠĠĠĠ ĠlistOf ( Tab lut Iter ative Deep ening Client (" black ", Ġ" Gen etic Simulation ", Ġ 3 0 )) ĊĠĠĠ Ġ) ĊĠĠĠ Ġ"$ white Weights ". to File (" white . txt ") ĊĊĠĠĠ Ġval Ġblack Weights Ġ= Ġgen et ically Computed Weights ( ĊĠĠĠĠĠĠĠ Ġinitial Population , ĊĠĠĠĠĠĠĠ ĠlistOf ( Tab lut Iter ative Deep ening Client (" white ", Ġ" Gen etic Simulation ", Ġ 3 0 )) ĊĠĠĠ Ġ) ĊĠĠĠ Ġ"$ black Weights ". to File (" black . txt ") Ċ } Ċ Ċ private Ġfun Ġgen et ically Computed Weights ( ĊĠĠĠ Ġinitial Population : ĠList < Individual < Double >>, ĊĠĠĠ Ġopponent s : ĠList < Tab lut Client > Ċ ): ĠList < Double > Ġ= ĠGen etic Algorithm For Numbers ( 4 , Ġ 0 . 0 , Ġ 1 0 0 . 0 , Ġ 0 . 1 ). gen etic Algorithm ( ĊĠĠĠ Ġinitial Population , ĊĠĠĠ ĠSimulation Function ( opp onent s ), ĊĠĠĠ ĠUN RE ACH ABLE _ GO AL , ĊĠĠĠ ĠMAX _ TIME _ SECONDS Ġ* Ġ 1 0 0 0 L Ċ ). let Ġ{ ĠGen etic He uristic ( it ). weights Ġ}