|
|
@ -80,13 +80,12 @@ main = do args <- getArgs |
|
|
|
let (ids,seeds,gamecomputations) = unzip3 loaddata |
|
|
|
inittime <- secTime |
|
|
|
results <- iterategc gamecomputations (timestruct timelimit inittime) memlimit |
|
|
|
putStrLn "lol" |
|
|
|
let (commandswpoints,strat) = unzip results |
|
|
|
let (commandlists, points) = unzip commandswpoints |
|
|
|
let wordlists = map cmdToString commandlists |
|
|
|
let outJSONstructs = zipWith3 (\x y z -> (JSONSer x y strategyTag z)) ids seeds wordlists |
|
|
|
BS.putStrLn $ encode outJSONstructs |
|
|
|
writelogfile logf (zip4 ids seeds points strat) |
|
|
|
writeLogFile logf (zip4 ids seeds points strat) |
|
|
|
where |
|
|
|
timestruct Nothing _ = Nothing |
|
|
|
timestruct (Just maxtime) intime = Just (maxtime, intime) |
|
|
@ -143,9 +142,9 @@ secTime :: IO Int64 |
|
|
|
secTime = do (TimeSpec s _) <- getTime Monotonic |
|
|
|
return s |
|
|
|
|
|
|
|
writelogfile :: Bool -> [(Int,Int,Int,Int)] -> IO () |
|
|
|
writelogfile False _ = return () |
|
|
|
writelogfile _ els = writeFile logFileName scoredata |
|
|
|
writeLogFile :: Bool -> [(Int,Int,Int,Int)] -> IO () |
|
|
|
writeLogFile False _ = return () |
|
|
|
writeLogFile _ els = writeFile logFileName scoredata |
|
|
|
where |
|
|
|
scoredata = foldl strlog "\n" els |
|
|
|
strlog x (a,b,c,d) = sa ++ sb ++ sc ++ sd ++ x ++ "\n" |
|
|
|