diff --git a/icfp2015.cabal b/icfp2015.cabal index 734a37d..7c61263 100644 --- a/icfp2015.cabal +++ b/icfp2015.cabal @@ -51,7 +51,7 @@ cabal-version: >=1.10 executable icfp2015 -- .hs or .lhs file containing the Main module. - main-is: Main0.hs + main-is: Main.hs -- Modules included in this executable, other than Main. other-modules: Datatypes, Datatypes.Board, Datatypes.Cell, Datatypes.Game, Datatypes.Unit @@ -60,7 +60,7 @@ executable icfp2015 other-extensions: OverloadedStrings, DeriveGeneric, DeriveDataTypeable -- Other library packages from which modules are imported. - build-depends: base >=4.6 && <4.9, hashable >=1.2 && <1.3, containers >=0.5 && <0.6, QuickCheck >=2.7 && <2.9, bytestring >=0.10 && <0.11, aeson >=0.8 && <0.9, pqueue >=1.3 && <1.4, clock >= 0.1 + build-depends: base >=4.6 && <4.9, hashable >=1.2 && <1.3, containers >=0.5 && <0.6, QuickCheck >=2.7 && <2.9, bytestring >=0.10 && <0.11, aeson >=0.8 && <0.9, pqueue >=1.3 && <1.4, clock, random -- Directories containing source files. hs-source-dirs: src diff --git a/src/Mainpf.hs b/src/Main.hs similarity index 97% rename from src/Mainpf.hs rename to src/Main.hs index bbaa0bc..8597033 100644 --- a/src/Mainpf.hs +++ b/src/Main.hs @@ -2,7 +2,7 @@ {-# LANGUAGE ExistentialQuantification #-} {-# OPTIONS -Wall #-} -module Mainf where +module Main where import Data.Int import Data.List @@ -29,11 +29,11 @@ logfilename :: String logfilename = "scores" timelimitratio :: Double -timelimitratio = 0.9 +timelimitratio = 1.0 memlimitratio :: Double -memlimitratio = 0.9 +memlimitratio = 1.0 gccompperstep :: Integer -gccompperstep = 100000 +gccompperstep = 100 data JSONSer = JSONSer { problemId :: Int, @@ -49,7 +49,7 @@ type Id = Int type Seed = Int strategies :: Game -> StdGen -> Maybe [Command] -> GameComputation -strategies g sgen cmd = [MkStrategyWrapper (initst g sgen cmd :: Strategy0)] +strategies g sgen cmd = [MkStrategyWrapper (initst g sgen cmd :: NullStrategy1)] -- = [MkStrategyWrapper (initst g sgen cmd :: NullStrategy1), -- MkStrategyWrapper (initst g sgen cmd :: NullStrategy2)] @@ -73,6 +73,7 @@ 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 @@ -118,8 +119,7 @@ iterategc gcs tlimit mlimit = do rtl <- timeLimit tlimit applyNtimes 1 f x = f x applyNtimes n f x = f (applyNtimes (n-1) f x) best = map getBestGameComputation gcs - - + timeLimit :: Maybe (Int,Int64) -> IO Bool timeLimit Nothing = return False timeLimit (Just (itime,limit)) = do atime <- secTime