-
Notifications
You must be signed in to change notification settings - Fork 0
/
agent-play.js
57 lines (46 loc) · 19.6 KB
/
agent-play.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
$.when(
$.getScript("https://cs.stanford.edu/people/karpathy/convnetjs/build/convnet.js"),
$.getScript("https://cs.stanford.edu/people/karpathy/convnetjs/build/util.js"),
$.getScript("https://cs.stanford.edu/people/karpathy/convnetjs/build/deepqlearn.js"),
$.Deferred(function (deferred) {
$(deferred.resolve);
})
).done(function () {
var num_inputs = 9;
var num_actions = 2;
var brain = new deepqlearn.Brain(num_inputs, num_actions);
// don't make any more random choices
brain.epsilon_test_time = 0.0;
brain.learning = false;
brain.value_net.fromJSON({"layers":[{"out_depth":9,"out_sx":1,"out_sy":1,"layer_type":"input"},{"out_depth":20,"out_sx":1,"out_sy":1,"layer_type":"fc","num_inputs":9,"l1_decay_mul":0,"l2_decay_mul":1,"filters":[{"sx":1,"sy":1,"depth":9,"w":{"0":0.3476535011726738,"1":0.1853550178525329,"2":0.16723982957219463,"3":0.034479665585190576,"4":-0.2299673960017409,"5":0.19926431268720193,"6":-0.23378396056905656,"7":-0.11113060816763518,"8":0.13164444243295154}},{"sx":1,"sy":1,"depth":9,"w":{"0":0.02032206805401973,"1":-0.014651570602956071,"2":0.047589838521266775,"3":-0.0030660723375837166,"4":-0.5243962168664508,"5":-0.10559673697525661,"6":-0.5962215531482983,"7":0.06153157972035999,"8":0.02177764801603115}},{"sx":1,"sy":1,"depth":9,"w":{"0":0.25641396761023266,"1":0.04098297594181217,"2":0.15574366647924753,"3":-0.17878695348395013,"4":0.3295502682536327,"5":-0.11394815454864313,"6":0.19394029948850094,"7":0.06391533544573941,"8":0.06283958638731357}},{"sx":1,"sy":1,"depth":9,"w":{"0":0.145673822632811,"1":0.31255869555765614,"2":-0.2698223867155165,"3":0.16375782243447268,"4":-0.17223581873335267,"5":-0.08500463243791201,"6":0.02961170864104705,"7":0.3311377593176654,"8":-0.025901851779011564}},{"sx":1,"sy":1,"depth":9,"w":{"0":0.09630129822505827,"1":0.3020839517372893,"2":-0.18809097354442555,"3":-0.1832731692619043,"4":0.0717534316950794,"5":-0.1805077682711937,"6":-0.07108724325104725,"7":0.5342657479145627,"8":-0.4965532633546397}},{"sx":1,"sy":1,"depth":9,"w":{"0":-0.23402517178148244,"1":-0.5037701315862527,"2":-0.09910802713182951,"3":-0.2716497143014685,"4":0.22099071009318408,"5":0.02497610987839593,"6":-0.7755830931450153,"7":-0.2675558620607322,"8":0.23913109050175227}},{"sx":1,"sy":1,"depth":9,"w":{"0":-0.25580844361504346,"1":0.05011836025485029,"2":0.5076002967823625,"3":-0.6001133875384431,"4":0.29977612648969626,"5":0.14859119888922068,"6":0.4112091010728016,"7":-0.05829932596330481,"8":0.33821588647022194}},{"sx":1,"sy":1,"depth":9,"w":{"0":-0.295368442176097,"1":0.05779634543232548,"2":0.17702634465697578,"3":-0.3452144112203977,"4":-0.001733515671513042,"5":-0.050198118369112095,"6":0.1503471178482887,"7":-0.314163978187081,"8":-0.18718639890639086}},{"sx":1,"sy":1,"depth":9,"w":{"0":-0.5023789626742945,"1":-0.05151681485049184,"2":-0.3141347082106584,"3":-0.1731614627955184,"4":-0.5198965381471385,"5":0.09169552300106153,"6":-0.6783491777835534,"7":-0.24401161424268297,"8":-0.3007645889005884}},{"sx":1,"sy":1,"depth":9,"w":{"0":0.4875358809384464,"1":0.3520645605181201,"2":-0.27933253065088504,"3":-0.50885183435723,"4":-0.11520789960022058,"5":-0.44923013486425006,"6":-0.23228978149976084,"7":0.20767152917839632,"8":-0.3147886957833003}},{"sx":1,"sy":1,"depth":9,"w":{"0":0.5468691705670982,"1":-0.17479028620126627,"2":0.24842006108619008,"3":-0.1734811843006372,"4":0.028230788077626356,"5":-0.45637817856449137,"6":-0.43351334565896166,"7":-0.01069967204654063,"8":-0.1697790218200782}},{"sx":1,"sy":1,"depth":9,"w":{"0":-0.17518168488804553,"1":-0.03271109564643579,"2":0.012618030499965783,"3":-0.14418002757208898,"4":-0.2327934746452716,"5":-0.057008071966719503,"6":0.6186220198696587,"7":-0.30126342195841316,"8":0.19146552615651904}},{"sx":1,"sy":1,"depth":9,"w":{"0":-0.10017013154389977,"1":-0.06717141818712391,"2":-0.08227630461050382,"3":-0.12126889979783013,"4":-0.0411418257660189,"5":-0.23237908271209795,"6":-0.18733005648929313,"7":0.7394346291915139,"8":0.23314524657241387}},{"sx":1,"sy":1,"depth":9,"w":{"0":-0.017291337040398563,"1":0.39348001621088985,"2":0.09532371890906245,"3":0.05409564180268913,"4":-0.04907744537130848,"5":-0.04541215314748598,"6":0.2737593205886304,"7":0.04936185985658037,"8":0.26006474626455833}},{"sx":1,"sy":1,"depth":9,"w":{"0":-0.02467229966717898,"1":0.5263514088392635,"2":-0.3097777815446034,"3":-0.21842749663412778,"4":0.03985694579858496,"5":0.15991320776202464,"6":-0.3474448527716498,"7":0.35766127517453666,"8":0.5288249034515473}},{"sx":1,"sy":1,"depth":9,"w":{"0":0.005091829793704817,"1":-0.0006404181816961635,"2":-0.020488873521419194,"3":-0.15332163103298918,"4":-0.32304583250089,"5":-0.2890065340733113,"6":0.1470309315368068,"7":-0.12742325405977095,"8":0.27212864330851616}},{"sx":1,"sy":1,"depth":9,"w":{"0":-0.37386062972803735,"1":0.4560884299713262,"2":0.013473414845391324,"3":0.3361839242360131,"4":0.025032490928820834,"5":0.24442671468468852,"6":0.0014498817332540014,"7":0.5879187757132129,"8":0.11789468957511626}},{"sx":1,"sy":1,"depth":9,"w":{"0":0.26214629713168586,"1":-0.18844081577147742,"2":0.15565422737824627,"3":0.1839101401960683,"4":0.0802607894723404,"5":-0.011834773840336151,"6":-0.026458639801972054,"7":0.11834365180725594,"8":-0.39878734017930556}},{"sx":1,"sy":1,"depth":9,"w":{"0":0.3330744688319556,"1":-0.05589168448974384,"2":-0.021949835822114,"3":0.08217670162289895,"4":0.1638970469845732,"5":-0.09583331322230207,"6":0.4036681441936107,"7":0.36229614477387956,"8":-0.06735049238930958}},{"sx":1,"sy":1,"depth":9,"w":{"0":0.02997139006563415,"1":0.0522771997331461,"2":-0.3545454306979931,"3":0.6457328763525214,"4":0.034626095401758775,"5":0.3996956750884449,"6":-0.41415322067805516,"7":-0.4267575088926515,"8":0.17165142053047452}}],"biases":{"sx":1,"sy":1,"depth":20,"w":{"0":0.0986152459142356,"1":0.1343669309192774,"2":0.10066488773057342,"3":0.11529771891675253,"4":0.09682840357923954,"5":0.16362152421805298,"6":0.1136721537780528,"7":0.09856100445234117,"8":0.1062200785095197,"9":0.06578299503184339,"10":0.09331530026557058,"11":0.10313634664180028,"12":0.12350424660785826,"13":0.10599104883821944,"14":0.10766583870384774,"15":0.1336184785484665,"16":0.09735637480766128,"17":0.09393335841317658,"18":0.12126254824044964,"19":0.09429145634437464}}},{"out_depth":20,"out_sx":1,"out_sy":1,"layer_type":"relu"},{"out_depth":20,"out_sx":1,"out_sy":1,"layer_type":"fc","num_inputs":20,"l1_decay_mul":0,"l2_decay_mul":1,"filters":[{"sx":1,"sy":1,"depth":20,"w":{"0":0.07507068090432698,"1":-0.18443705353373016,"2":-0.02425912922842042,"3":0.2976663534517553,"4":0.1139649856232263,"5":0.29960583717018957,"6":-0.07821001922315605,"7":0.1488380537899294,"8":-0.18010100281049535,"9":0.053983599918403166,"10":-0.0867816518112722,"11":-0.05935236425938624,"12":0.4817087235246094,"13":0.21491782266198042,"14":0.12072514908346707,"15":-0.49964350708730826,"16":-0.21136031132741911,"17":-0.016256296292062745,"18":0.07859665950254427,"19":0.011631818377632478}},{"sx":1,"sy":1,"depth":20,"w":{"0":0.15502402646253666,"1":0.12345767993389369,"2":0.7378081561892953,"3":-0.08120517303735769,"4":0.34617129889250337,"5":-0.047658365982350806,"6":0.07603872279023895,"7":-0.1271791471366303,"8":0.17457771899545244,"9":0.34417338259271424,"10":-0.4701470034783838,"11":0.19392698438223196,"12":-0.37123469881076954,"13":-0.1575588413378356,"14":-0.04958731943212936,"15":0.02735417880658452,"16":-0.13256198644198014,"17":-0.0013718672162869902,"18":0.19277042252659748,"19":-0.08392354333284824}},{"sx":1,"sy":1,"depth":20,"w":{"0":0.01997764910887338,"1":0.4619068343609375,"2":-0.11985690577620288,"3":0.062395006163436455,"4":0.15380031728972288,"5":-0.13275608797495475,"6":-0.10804437781229406,"7":-0.11349946027337725,"8":-0.00009487626353142996,"9":-0.07158795948804747,"10":0.1575867486174891,"11":-0.007077082549662959,"12":-0.08004270177142726,"13":-0.04114276676659374,"14":0.17058203038837028,"15":-0.03838040479824592,"16":0.01445151850635839,"17":0.0177859556642257,"18":-0.28760145152296723,"19":-0.13399201652202655}},{"sx":1,"sy":1,"depth":20,"w":{"0":0.24240376849574904,"1":-0.37735396235640706,"2":-0.011856188532991004,"3":0.2157050296272681,"4":0.17467902476586786,"5":-0.06400983709355823,"6":-0.008670712300488747,"7":-0.058651059571982904,"8":-0.11038884457639232,"9":0.03006056159938622,"10":0.18614036544485246,"11":0.3473170346729709,"12":0.4801422129584481,"13":-0.05139781944661423,"14":0.17399019160936935,"15":-0.01972024856972266,"16":0.004987341970590921,"17":0.18645545221081258,"18":0.1507449013413327,"19":-0.23962370053864304}},{"sx":1,"sy":1,"depth":20,"w":{"0":-0.45332218695175325,"1":0.051178405095531065,"2":0.06263199946382587,"3":0.2641218737586396,"4":0.06996336238422558,"5":0.06479003058153357,"6":0.09379029659342326,"7":-0.013976223825490264,"8":-0.14877687267473227,"9":0.2682322999541873,"10":0.156868818216906,"11":0.3500052048649939,"12":-0.35695361568622436,"13":0.04023575233881221,"14":0.08203720443418958,"15":-0.15036261401968926,"16":0.19834096568312598,"17":0.03743161145346947,"18":-0.05416001037134517,"19":0.032838185682376474}},{"sx":1,"sy":1,"depth":20,"w":{"0":0.3974189865841181,"1":-0.2758183472612257,"2":0.28982858676191664,"3":-0.397789133993901,"4":0.0680471611822455,"5":-0.323949503137019,"6":-0.2647022672685922,"7":0.17289148969325285,"8":0.28236693474782015,"9":-0.13036723320484206,"10":-0.369127680840191,"11":-0.7146050587999371,"12":0.0756481017035742,"13":-0.2019193708502152,"14":-0.09095464140139371,"15":0.06365979279633589,"16":-0.22879829766758375,"17":0.01709917219375517,"18":-0.23874096541904477,"19":-0.0012881196287537415}},{"sx":1,"sy":1,"depth":20,"w":{"0":0.07206051513843138,"1":0.1736587310131421,"2":0.18043223073063336,"3":0.02856360969010056,"4":-0.18736264211835363,"5":-0.16412756514301216,"6":0.0959292801644288,"7":-0.03380411713699137,"8":-0.105861055759855,"9":0.05006135340083669,"10":-0.1652435045463959,"11":0.015756293220818125,"12":0.09392845999117617,"13":0.07315460406373898,"14":-0.2610834675873872,"15":-0.029680915633189715,"16":0.30201791915875764,"17":0.018302872254362328,"18":0.27122089249429115,"19":-0.0045825761955184015}},{"sx":1,"sy":1,"depth":20,"w":{"0":0.0862975382558688,"1":0.5136180728921832,"2":0.025813203730586397,"3":-0.27317984808361073,"4":0.25154292463114963,"5":-0.42242774305905356,"6":0.07757886982965977,"7":-0.10255481285211873,"8":-0.16728497098204323,"9":-0.2725063684267932,"10":-0.016446969952396105,"11":0.18278389925320776,"12":-0.24302623881220559,"13":0.3345464273923598,"14":-0.10614664788125205,"15":0.1552085221098026,"16":0.269308642636546,"17":-0.03157155345927137,"18":0.09771187257713793,"19":0.21151902663607464}},{"sx":1,"sy":1,"depth":20,"w":{"0":-0.04013934437099181,"1":0.19746640662615628,"2":0.19359692362704328,"3":-0.11966713798301824,"4":-0.1987698348210146,"5":-0.040471180524544924,"6":0.08380571026811352,"7":0.14703326027751007,"8":-0.05125410812399614,"9":0.011646594823490768,"10":0.05452128701708508,"11":0.18656872311762981,"12":-0.17822425198972885,"13":-0.026978609305060387,"14":0.24567599676644125,"15":-0.06561320674887806,"16":0.15491850153862785,"17":-0.026749509448395506,"18":0.3292741693971731,"19":-0.2658863290705809}},{"sx":1,"sy":1,"depth":20,"w":{"0":-0.5107720457082242,"1":-0.09303425098329339,"2":0.12220351090544461,"3":-0.049330953953916255,"4":-0.0895111863292985,"5":0.12505915200101214,"6":0.06574502518652728,"7":-0.14126252264866637,"8":0.12296626395577086,"9":-0.36783853323301535,"10":-0.025026233946155736,"11":0.2378432644326349,"12":-0.045447459662718216,"13":-0.010029711238482139,"14":0.4404725003902986,"15":-0.10112834740981637,"16":0.18674172120513788,"17":0.08073923558196991,"18":0.31838051360999203,"19":0.06394443315941765}},{"sx":1,"sy":1,"depth":20,"w":{"0":-0.04674472309552948,"1":-0.12229205037870751,"2":0.16002109564447486,"3":-0.29417280767129145,"4":-0.09850288227017279,"5":0.29413965025468003,"6":-0.3650446235764762,"7":-0.28008338220769696,"8":-0.003304834066479326,"9":0.1163448053619287,"10":0.27983395266308586,"11":0.16778889443018197,"12":0.3732132952855856,"13":-0.048799258048136424,"14":0.035987244775006706,"15":0.020858481791822047,"16":0.1348587416783142,"17":0.0679893939167475,"18":0.07136897806730387,"19":-0.18918915117910334}},{"sx":1,"sy":1,"depth":20,"w":{"0":-0.034526676517730386,"1":0.191779858136332,"2":0.07254100606491,"3":0.35822374377770994,"4":-0.05736220683202302,"5":0.36606336003779105,"6":0.13510444151564685,"7":0.10014183138629232,"8":0.23331922250562354,"9":-0.3703528570947358,"10":0.2390680145170986,"11":0.07154020806544878,"12":0.239676277903586,"13":-0.24664731084536734,"14":0.20784378096514924,"15":-0.042904291710111106,"16":-0.12129416344384196,"17":0.1619568769936681,"18":-0.09323106704559161,"19":0.08119693976117744}},{"sx":1,"sy":1,"depth":20,"w":{"0":-0.09925254744337049,"1":0.10365287440450215,"2":-0.23623649309678413,"3":0.07784437748169364,"4":0.4214800810576817,"5":-0.2051850096775566,"6":0.022056584827679294,"7":-0.44113244427706466,"8":-0.1493852310150294,"9":-0.16535305442088133,"10":-0.2457438801425876,"11":0.23866866587337282,"12":0.12154681033390338,"13":-0.08543308507793602,"14":0.415589048333785,"15":0.34982745965689027,"16":0.3114211762731886,"17":-0.02775090693015202,"18":0.07986459711877165,"19":-0.20453348718416273}},{"sx":1,"sy":1,"depth":20,"w":{"0":-0.3232256730211543,"1":-0.31053462414572863,"2":0.10577729540206747,"3":-0.14430219883584786,"4":-0.1940900783811811,"5":0.11766327246538014,"6":-0.021497756179692656,"7":-0.025402526017017736,"8":-0.2952639709502173,"9":0.13404861038295365,"10":-0.31933280960693283,"11":-0.18429661236277245,"12":0.27450731269594164,"13":-0.07882859671301752,"14":-0.0833911448540776,"15":-0.05255766546481895,"16":-0.08149246031372298,"17":0.14974229934831537,"18":-0.2407214845835794,"19":0.2109151582493389}},{"sx":1,"sy":1,"depth":20,"w":{"0":0.09094129125097361,"1":0.023842256755392054,"2":0.004912256320533308,"3":-0.229781572045564,"4":0.04043985625770437,"5":-0.18499450959921557,"6":0.008002329928082318,"7":-0.060693046287362405,"8":-0.01157046191275519,"9":0.2558806358974402,"10":-0.3197341909731952,"11":0.25460498717363134,"12":0.2203126535813081,"13":-0.02610116298570944,"14":0.26716017791680136,"15":-0.12620119394744442,"16":-0.07820159907540368,"17":0.055360885508176146,"18":0.3988318992194682,"19":-0.07884708151442087}},{"sx":1,"sy":1,"depth":20,"w":{"0":0.07761826514380248,"1":-0.1160331361985035,"2":-0.1971331291849645,"3":-0.32263410608750287,"4":0.09965438623433164,"5":-0.13997136581973055,"6":0.132630256199112,"7":-0.01866437923075747,"8":0.03956927242419362,"9":-0.06363252430411642,"10":0.16840882973614893,"11":-0.13489586729217592,"12":0.27426470932389296,"13":0.20378130011481252,"14":0.10989389873587468,"15":-0.10230259487911335,"16":0.15583035068593298,"17":-0.08907153795335886,"18":0.14753188955748986,"19":-0.3494443348459172}},{"sx":1,"sy":1,"depth":20,"w":{"0":0.07890185648302683,"1":-0.00015164369770616934,"2":0.07035863348469328,"3":0.03305424816554517,"4":-0.1217819398024094,"5":0.07081752628295054,"6":0.6328093486507712,"7":-0.013331339986826037,"8":-0.15044738030840746,"9":-0.028112030767238255,"10":-0.5419498119439177,"11":0.12545770508567033,"12":-0.00675812001727219,"13":-0.22925409898634963,"14":0.11739550016558929,"15":-0.3275289575952495,"16":-0.3366400475618214,"17":0.45492692802064844,"18":0.07556378221345689,"19":0.10517960936909622}},{"sx":1,"sy":1,"depth":20,"w":{"0":0.2278094492738535,"1":-0.06484915707757061,"2":-0.031402772425351916,"3":-0.15505756886506047,"4":0.3231971204452219,"5":0.0980209547170581,"6":-0.3561345559244381,"7":0.20747052963870255,"8":0.42704696153892435,"9":-0.12914176384622927,"10":0.45369437251253103,"11":0.274937228106577,"12":-0.4660395837605327,"13":-0.23143332271868436,"14":0.1375245344628973,"15":-0.08812061827755323,"16":-0.420594635385786,"17":-0.09587693813623256,"18":0.042950481272901124,"19":0.12287101512467659}},{"sx":1,"sy":1,"depth":20,"w":{"0":-0.2791607712744918,"1":0.047907046336242314,"2":-0.031997067034286536,"3":-0.3159064550357993,"4":0.3038602017592523,"5":-0.0028568883587227712,"6":-0.08462561005697769,"7":-0.025169813238941744,"8":-0.2926488539448795,"9":-0.17565443642628695,"10":-0.13809309219237179,"11":0.13336760683616683,"12":-0.18522343798017868,"13":-0.07724036997561304,"14":-0.14767269341913158,"15":0.30076611978604134,"16":-0.5060467251003024,"17":-0.041898710245105567,"18":-0.07433063410846365,"19":0.27810245031313613}},{"sx":1,"sy":1,"depth":20,"w":{"0":0.08183641757109338,"1":-0.05543351792915555,"2":-0.10663212007084279,"3":0.10360510573152522,"4":0.2875055419047866,"5":0.4653277767576731,"6":-0.017062126428579613,"7":0.2704203187532524,"8":0.2262873935774129,"9":-0.23187615690903024,"10":-0.09901159971249787,"11":-0.17274597990373008,"12":0.0447805000142196,"13":-0.1479285744552422,"14":-0.18598858300977905,"15":-0.36978777445877953,"16":0.26298128735683035,"17":0.3828879612092343,"18":0.15894643402755626,"19":0.016585766678860813}}],"biases":{"sx":1,"sy":1,"depth":20,"w":{"0":0.09533977266204821,"1":0.10424375790439003,"2":0.10382084795985233,"3":0.05110035796668235,"4":0.09638259997084506,"5":0.1,"6":0.09444330151226707,"7":0.09309338944127775,"8":0.12169711684323174,"9":0.07677902640279081,"10":0.1413468765480986,"11":0.17989891886612275,"12":0.10922844631643115,"13":0.11346657020707557,"14":0.12527702193985008,"15":0.08927726632708644,"16":0.10698719752232115,"17":0.07436408359569933,"18":0.10645161331489314,"19":0.10300572908197415}}},{"out_depth":20,"out_sx":1,"out_sy":1,"layer_type":"relu"},{"out_depth":2,"out_sx":1,"out_sy":1,"layer_type":"fc","num_inputs":20,"l1_decay_mul":0,"l2_decay_mul":1,"filters":[{"sx":1,"sy":1,"depth":20,"w":{"0":-0.05321852313720926,"1":0.0022571624409285338,"2":0.19140661589624378,"3":0.13530607735095976,"4":-0.1565294462612116,"5":0.08528258074744802,"6":0.11461103456387761,"7":-0.16872100521118324,"8":-0.0473405011431852,"9":0.14816047723386006,"10":-0.22541728800511748,"11":-0.2555364346505722,"12":0.07610758780066758,"13":-0.3604699069961699,"14":-0.03634968173053572,"15":-0.054824248443758064,"16":0.008610785198836887,"17":0.2161002571039061,"18":-0.06684994156318613,"19":0.013298984329019223}},{"sx":1,"sy":1,"depth":20,"w":{"0":-0.04008118850231675,"1":-0.014567633789047777,"2":-0.39839058338519734,"3":0.2846003048117469,"4":-0.030031206801740522,"5":0.15662463921380188,"6":-0.08332351569489338,"7":-0.04254533653942502,"8":-0.23837136030475578,"9":0.33240046332195106,"10":-0.06682185001356536,"11":-0.3233210555664847,"12":-0.17737736434138834,"13":0.40991086040247876,"14":-0.061729594625572703,"15":0.07423910041224493,"16":0.011349617946141838,"17":-0.08565723250376914,"18":-0.04715840539216034,"19":0.0024752037314144854}}],"biases":{"sx":1,"sy":1,"depth":2,"w":{"0":-0.14477980245095584,"1":-0.1065195967849082}}},{"out_depth":2,"out_sx":1,"out_sy":1,"layer_type":"regression","num_inputs":2}]});
function brainAction() {
return brain.forward([
state.card.choices.a.values.valuation,
state.card.choices.a.values.happiness,
state.card.choices.a.values.time,
state.card.choices.b.values.valuation,
state.card.choices.b.values.happiness,
state.card.choices.b.values.time,
state.happiness / 10.0,
state.valuation / 100.0,
state.time
]);
}
function brainPlay() {
brainAction() === 0 ? $buttonA.click() : $buttonB.click();
}
var brainplayId = setInterval(function () {
brainPlay()
if (state.win != null) {
if (state.win) {
console.log("Won with valuation: " + state.valuation);
} else {
console.log("Lost for reason: " + state.defeatReason);
}
resetGame();
startGame();
}
}, 3000);
$startBtn.click();
$('.button-im-ready').click();
});