Skip to content

Commit

Permalink
add context paragraph to resources
Browse files Browse the repository at this point in the history
  • Loading branch information
jashlu committed Sep 26, 2024
1 parent b836c23 commit 0d2c2f7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/social_norms_trees/resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,6 @@
"type": "Dummy"
}

}
},
"context": "This is a sample context paragraph that describes the context of the enviornment in which the robot is being tasked with operating in. This context should affect the decision making, rendering some actions relevant and others less relevant in this specific context."
}
13 changes: 8 additions & 5 deletions src/social_norms_trees/ui_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,15 @@ def load_resources(file_path):


behavior_tree = resources.get('behavior_tree')
behaviors = resources.get('behavior_library')
behavior_list = resources.get('behavior_library')
context_paragraph = resources.get('context')

behavior_library = BehaviorLibrary(behaviors)
behavior_library = BehaviorLibrary(behavior_list)

behavior_tree = deserialize_tree(behavior_tree, behavior_library)

print("Loading success.")
return behavior_tree, behavior_library
return behavior_tree, behavior_library, context_paragraph

def initialize_experiment_record(db, participant_id, origin_tree):

Expand Down Expand Up @@ -145,16 +146,18 @@ def main():
print("AIT Prototype #1 Simulator")


#TODO: define a input file, that will have the original tree and also the behavior library
#TODO: write up some context, assumptions made in the README

#TODO: user query for files
DB_FILE = "db.json"
db = load_db(DB_FILE)

#load tree to run experiment on, and behavior library

RESOURCES_FILE = "resources.json"
original_tree, behavior_library = load_resources(RESOURCES_FILE)
original_tree, behavior_library, context_paragraph = load_resources(RESOURCES_FILE)

print(f"\nContext of this experiment: {context_paragraph}")

participant_id, experiment_id = experiment_setup(db, original_tree)
db = run_experiment(db, original_tree, experiment_id, behavior_library)
Expand Down

0 comments on commit 0d2c2f7

Please sign in to comment.