-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
53 lines (49 loc) · 1.32 KB
/
main.go
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
package main
import (
/*"github.com/pedroallenrevez/goTheory/gameTheory"*/
"github.com/pedroallenrevez/goTheory/mcts"
)
func main() {
/*
var impl = new(gameTheory.PrisonerDilemma)
var g gameTheory.PDInterface = impl
//create actions
var actionJackson = new(action.Action)
var a action.AInterface = actionJackson
action1 := a.CreateAction("yolo")
action2 := a.CreateAction("swag")
actArray := make([]*action.Action, 2)
actArray[0] = action1
actArray[1] = action2
//create players
var agentJackson = new(agent.Agent)
var ag agent.AgInterface = agentJackson
var strat agent.Strategy = func() *action.Action {
return action1
}
p1 := ag.CreateAgent(actArray, strat)
strat = func() *action.Action {
return action2
}
p2 := ag.CreateAgent(actArray, strat)
players := make([]*agent.Agent, 2)
players[0] = p1
players[1] = p2
//create game
pd := g.CreatePDilemma(actArray, players, 1.8, 1.0, 0.0, 0.0)
gameTheory.PrintGame(pd)
pd.Solve()
fmt.Println(p1.TotalScore)
fmt.Println(p2.TotalScore)
//g.LoadPrisonerDilemma(pd, 1.9, 1.0, 0.0, 0.0)
*/
var impl = new(mcts.GameManager)
var gman mcts.GManInterface = impl
// width height nskaters speed radius r1 r2
gman.Init(10, 10, 5, 1, 1, 1, 0)
NumTurns := 100
for x := 0; x < NumTurns; x++ {
//gman.PrintSkaters()
gman.Update()
}
}