-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbase_utils.py
65 lines (63 loc) · 3.55 KB
/
base_utils.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
57
58
59
60
61
62
63
64
65
class Logger():
LINE_SEP = '-'*85
@staticmethod
def init_message(debug):
print(Logger.LINE_SEP)
print("{0:>42}".format("Welcome to NACE!"))
print(Logger.LINE_SEP)
if debug:
print("Debugger:{0}"\
"enter this mode to let agent World_Move{0}" \
"w/a/s/d : manual World_Movement in simulated world{0}" \
"v : switch to imagined world{0}" \
"l : list hypotheses{0}" \
"p : look through the predicted plan step-wise{0}" \
"q : exit imagined world".format('\n\t'))
else:
print("COMMAND-LINE PARAMETERS:{0}" \
"\"debug\" : interactive debugging{0}" \
"\"silent\" : hiding hypothesis formation output{0}" \
"\"manual\" : trying the environment as a human{0}" \
"\"nosleep\" : removes simulation visualization delay{0}" \
"\"nopredictions\" : hides prediction rectangles{0}" \
"\"nogui\" : hidea GUI{0}" \
"\"notextures\" : renders textures in GUI{0}" \
"\"colors\" : renders colors{0}" \
"\"interactive\" : enables MeTTa-NARS bridge with shell{0}" \
"\"adversary\" : add a shell-controllable player character{0}" \
"\"frames=b\" : creates a gif file including frames until frame b{0}" \
"\"startframe=a\" : optional to let the gif start later{0}" \
"\"world=k\" : starts world k without asking for the world input{0}" \
"\"ona\" : uses ONA with MeTTa interface in world=9 instead of MeTTa-NARS{0}" \
"\"atomicaction\" : forces navigation stack to move between individual grid cells{0}" \
"\"input.metta\" : whether to use input.metta instead of stdin{0}" \
"\"spaces\" : enables MeTTa-NARS bridge with shell{0}" \
"\"saveknowledge\" : save agent knowledge to knowledge file{0}" \
"\"loadknowledge\" : load agent knowledge from knowledge file{0}" \
"\"narsese\" : allows Narsese input instead of MeTTa to use the Bridge.".format('\n\t'))
@staticmethod
def world_init_message(manual, challenge_input):
print(Logger.LINE_SEP)
if manual:
if challenge_input:
print("Enter one of 1-9 to try a world:")
else:
print("Input the desired world number from below and press enter.{0}" \
"WORLDS:{0}" \
"{1}1: Food collecting{0}" \
"{1}2: Cup on table challenge{0}" \
"{1}3: Doors and keys{0}" \
"{1}4: Food collecting with moving object{0}" \
"{1}5: Pong game{0}" \
"{1}6: Bring eggs to chicken {0}" \
"{1}7: Soccer{0}" \
"{1}8: Shock world{0}" \
"BRIDGE WORLDS:{0}" \
"{1}9: world with MeTTa-Narsese console input demanding NARS installation{0}" \
"MINIGRID WORLDS:{0}" \
"{1}11-20: Interesting MiniGrids{0}" \
"{1}30-37: Empty grids{0}" \
"NEW WORLDS:{0}" \
"{1} 0: Adversary world \"with player character\"{0}" \
"{1}-1: Puzzleworld \"minus 1 indeed\"{0}" \
"{1}-2: ROS2 bridge".format('\n\t', ' '))