|
@ -1,3 +1,4 @@ |
|
|
|
|
|
{-# LANGUAGE BangPatterns #-} |
|
|
{-# LANGUAGE DeriveGeneric #-} |
|
|
{-# LANGUAGE DeriveGeneric #-} |
|
|
{-# LANGUAGE ExistentialQuantification #-} |
|
|
{-# LANGUAGE ExistentialQuantification #-} |
|
|
{-# OPTIONS -Wall #-} |
|
|
{-# OPTIONS -Wall #-} |
|
@ -49,7 +50,7 @@ type Id = Int |
|
|
type Seed = Int |
|
|
type Seed = Int |
|
|
|
|
|
|
|
|
strategies :: Game -> StdGen -> Maybe [Command] -> GameComputation |
|
|
strategies :: Game -> StdGen -> Maybe [Command] -> GameComputation |
|
|
strategies g sgen cmd = [MkStrategyWrapper (initst g sgen cmd :: NullStrategy1)] |
|
|
|
|
|
|
|
|
strategies g sgen cmd = [MkStrategyWrapper (initst g sgen cmd :: Strategy0)] |
|
|
|
|
|
|
|
|
-- = [MkStrategyWrapper (initst g sgen cmd :: NullStrategy1), |
|
|
-- = [MkStrategyWrapper (initst g sgen cmd :: NullStrategy1), |
|
|
-- MkStrategyWrapper (initst g sgen cmd :: NullStrategy2)] |
|
|
-- MkStrategyWrapper (initst g sgen cmd :: NullStrategy2)] |
|
@ -106,8 +107,8 @@ readFiles (x:xs) = do f <- BS.readFile x |
|
|
|
|
|
|
|
|
iterategc :: [GameComputation] -> Maybe (Int,Int64) -> Maybe Int -> IO [(([Command], Int), Int)] |
|
|
iterategc :: [GameComputation] -> Maybe (Int,Int64) -> Maybe Int -> IO [(([Command], Int), Int)] |
|
|
iterategc gcs tlimit mlimit = do rtl <- timeLimit tlimit |
|
|
iterategc gcs tlimit mlimit = do rtl <- timeLimit tlimit |
|
|
rml <- memLimit mlimit |
|
|
|
|
|
(gcresult rtl rml) |
|
|
|
|
|
|
|
|
rml <- memLimit mlimit |
|
|
|
|
|
(gcresult rtl rml) |
|
|
where |
|
|
where |
|
|
gcresult True _ = return best |
|
|
gcresult True _ = return best |
|
|
gcresult _ True = return best |
|
|
gcresult _ True = return best |
|
|