main = runThrLocMainIO $ do
  tCount <- getNumCapabilities
  let gCount = 1000
      gtCount = gCount `div` tCount
      gtCountExtra = gCount - (gtCount * tCount)

      -- first thread do extra jobs
      ttGCount 1 = gtCountExtra + gtCount
      ttGCount _ = gtCount

      threadJob tNum = do
         a1 <- mkAgent 15 :: IO AgentMCTS
--         a1 <- mkAgent () :: IO AgentRandom
         a2 <- mkAgent () :: IO AgentRandom
         winners <- sequence $ replicate (ttGCount tNum) (oneGame a1 a2)
         return winners

  asyncThreads <- mapM (async . threadJob) [1..tCount]
  all'winners <- mapM wait asyncThreads
  let counts = map (head &&& length) $ group $ sort $ concat all'winners
  
  print counts

  return ()
main = runThrLocMainIO $ do
  tCount <- getNumCapabilities
  let gCount = 1000
      gtCount = gCount `div` tCount
      gtCountExtra = gCount - (gtCount * tCount)

      -- first thread do extra jobs
      ttGCount 1 = gtCountExtra + gtCount
      ttGCount _ = gtCount

      threadJob tNum = do
         a1 <- mkAgent 15 :: IO AgentMCTS
--         a1 <- mkAgent () :: IO AgentRandom
         a2 <- mkAgent () :: IO AgentRandom
         winners <- sequence $ replicate (ttGCount tNum) (oneGame a1 a2)
         return winners

  asyncThreads <- mapM (async . threadJob) [1..tCount]
  all'winners <- mapM wait asyncThreads
  let counts = map (head &&& length) $ group $ sort $ concat all'winners
  
  print counts

  return ()
main = runThrLocMainIO $ do
  tCount <- getNumCapabilities
  let gCount = 1000
      gtCount = gCount `div` tCount
      gtCountExtra = gCount - (gtCount * tCount)

      -- first thread do extra jobs
      ttGCount 1 = gtCountExtra + gtCount
      ttGCount _ = gtCount

      threadJob tNum = do
         a1 <- mkAgent 15 :: IO AgentMCTS
--         a1 <- mkAgent () :: IO AgentRandom
         a2 <- mkAgent () :: IO AgentRandom
         winners <- sequence $ replicate (ttGCount tNum) (oneGame a1 a2)
         return winners

  asyncThreads <- mapM (async . threadJob) [1..tCount]
  all'winners <- mapM wait asyncThreads
  let counts = map (head &&& length) $ group $ sort $ concat all'winners
  
  print counts

  return ()