Newer
Older
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
import random
from pprint import pprint
import numpy as np
# Initialisation du board
g = [[0 for j in range(15)]for i in range(15)]
# pprint(g)
# Liens entre les cases
for i in range(9):
g[i][i+1]=1
for i in range(10,14):
g[i][i+1]=1
g[2][10]=1
g[9][14]=1
pprint(g)
# 3 types de dés
def safe():
choix = [0,1]
return random.choices(choix,[0.5, 0.5])[0]
def normal():
choix = [0,1,2]
return random.choices(choix,[0.33, 0.33, 0.33])[0]
def risky():
choix = [0,1,2,3]
return random.choices(choix,[0.25, 0.25, 0.25, 0.25])[0]
# markovDecision(layout,circle)
np.random.seed(0)
layout = np.ndarray([0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 1, 0])
choices = [0,1,2,3]
print(layout)
print(np.linspace(1,15,15, dtype=np.float16))