-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsimulationconfig.py
56 lines (52 loc) · 1.51 KB
/
simulationconfig.py
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
54
55
56
# Copyright 2022-, Semiotic AI, Inc.
# SPDX-License-Identifier: Apache-2.0
import numpy as np
from simulation import simulation_ingredient
@simulation_ingredient.config
def config():
nproducts = 1 # This is a convenience variable. Does not actually get used by the simulation.
ntimesteps = 10000
nepisodes = 1
distributor = {"kind": "softmax", "source": "consumer", "to": "indexer"}
entities = [
{
"kind": "entity",
"count": 1,
"group": "consumer",
"state": {
"kind": "budget",
"low": 0,
"high": 1,
"initial": 0.5 * np.ones(nproducts),
"traffic": np.ones(nproducts),
},
},
{
"kind": "agent",
"count": 1,
"group": "indexer",
"state": {
"kind": "price",
"low": np.zeros(nproducts),
"high": 3 * np.ones(nproducts),
"initial": np.ones(nproducts),
},
"action": {
"kind": "price",
"low": np.zeros(nproducts),
"high": 3 * np.ones(nproducts),
"shape": (nproducts,),
},
"reward": [
{
"kind": "traffic",
"multiplier": 1,
}
],
"observation": [
{
"kind": "bandit",
}
],
},
]