Skip to content
This repository has been archived by the owner on Feb 11, 2025. It is now read-only.

Commit

Permalink
Merge pull request #30 from brown-ccv/add-context-paragraph
Browse files Browse the repository at this point in the history
add context paragraph to resources
  • Loading branch information
jashlu authored Sep 30, 2024
2 parents b836c23 + 50e2c87 commit fa2bf38
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 paragraph that describes the context of the environment in which the robot is operating. This context might affect the decision making, rendering some actions relevant and others less relevant."
}
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 fa2bf38

Please sign in to comment.