-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
44 lines (36 loc) · 901 Bytes
/
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
package main
import (
"fmt"
"log"
"math/rand"
"strconv"
"time"
"example/OSURisk/config"
"example/OSURisk/person"
"example/OSURisk/simulation"
)
/*
TODO
10人だと住居スペースが縦に並ぶ。
Eatは絶対ホームに戻る
LifeActionElapsedTimeのInitilizeがいるのでは??
stay と Strollは乱数で前後させたいな。
*/
func main() {
var config = config.Config
rand.Seed(time.Now().Unix())
people := simulation.NewPeople(config.PeopleCount)
people.SetInfected(config.InfectedCount)
mapSize := person.Position{Y: config.MapSizeY, X: config.MapSizeX}
//simulationの設定
s, err := simulation.NewSimulationModel(mapSize, config.GridCapacity, 7, people)
if err != nil {
log.Fatal(err)
}
interval, err := time.ParseDuration(strconv.Itoa(config.TimeInterval) + "s")
if err != nil {
log.Fatal(err)
}
s.Run(interval)
fmt.Printf("\nDone!\n")
}