-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
wouter
committed
Jun 4, 2020
1 parent
a17aab9
commit 51d77a3
Showing
1 changed file
with
18 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,36 @@ | ||
from aiagents.multi.BasicComplexAgent import BasicComplexAgent | ||
from aiagents.single.RandomAgent import RandomAgent | ||
from gym.spaces import Discrete | ||
from gym.spaces import Discrete, Dict | ||
import logging | ||
|
||
logger = logging.getLogger() | ||
logger.setLevel(logging.DEBUG) | ||
|
||
|
||
def main(): | ||
|
||
N_agents=10 | ||
i=0 | ||
action_space=Discrete(3) | ||
simpleComponentList=[] | ||
N_agents = 10 | ||
i = 0 | ||
action_space = Dict({ n: Discrete(3) for n in range(N_agents) }) | ||
obs_space = None # not used anyway in this demo | ||
simpleComponentList = [] | ||
|
||
while( i < N_agents ): | ||
simpleComponentList.append(RandomAgent(i, action_space)) | ||
i+=1 | ||
while(i < N_agents): | ||
simpleComponentList.append(RandomAgent(i, action_space, obs_space)) | ||
i += 1 | ||
|
||
myComplexComponent=BasicComplexAgent(simpleComponentList) | ||
myComplexComponent = BasicComplexAgent(simpleComponentList, action_space, obs_space) | ||
|
||
N_steps=3 | ||
i=0 | ||
state=0 | ||
N_steps = 3 | ||
i = 0 | ||
state = 0 | ||
|
||
while i<N_steps: | ||
while i < N_steps: | ||
myComplexComponent.step(state) | ||
i+=1 | ||
i += 1 | ||
return 0 | ||
|
||
|
||
if __name__== "__main__": | ||
if __name__ == "__main__": | ||
main() | ||
|