-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added a planning interface and renamed the DDL interface to learners. … #53
Merged
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
26e6de8
added a planning intrface and renamed the DDL interface to learners. …
ced65ec
Needed to add a test_planner_interface suite
3bfd5ee
removed extra lines and double import
dcbb457
Changed the planner interface a bit in order to handle the disambigua…
7fc6c23
updated tests
4239264
added a planning intrface and renamed the DDL interface to learners. …
3e44cff
Needed to add a test_planner_interface suite
554e34e
removed extra lines and double import
036127d
Changed the planner interface a bit in order to handle the disambigua…
8b38584
updated tests
a708744
Added tests to cover pass only methods
asgibson 0208034
Removed a lingering merge req comment?
09e1a29
Merge branch 'main' into 50-add-interface-to-planners
16f36ce
Merge branch 'main' into 50-add-interface-to-planners
4e7b0ec
added a planning intrface and renamed the DDL interface to learners. …
b459c5e
Needed to add a test_planner_interface suite
5bacff1
removed extra lines and double import
a147192
Changed the planner interface a bit in order to handle the disambigua…
4190a61
updated tests
3adf4c5
Added tests to cover pass only methods
asgibson 2d84335
Fixed planner tests
asgibson 306d459
resolving a merge conflict with tests
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# GSC-19165-1, "The On-Board Artificial Intelligence Research (OnAIR) Platform" | ||
# | ||
# Copyright © 2023 United States Government as represented by the Administrator of | ||
# the National Aeronautics and Space Administration. No copyright is claimed in the | ||
# United States under Title 17, U.S. Code. All Other Rights Reserved. | ||
# | ||
# Licensed under the NASA Open Source Agreement version 1.3 | ||
# See "NOSA GSC-19165-1 OnAIR.pdf" | ||
|
||
""" | ||
Planners interface class for managing all planning-based AI components | ||
""" | ||
import importlib.util | ||
import importlib.util | ||
|
||
from ..util.data_conversion import * | ||
|
||
class PlannersInterface: | ||
def __init__(self, headers, _ai_plugins={}): | ||
assert(len(headers)>0), 'Headers are required' | ||
self.headers = headers | ||
self.planning_constructs = [] | ||
for module_name in list(_planning_plugins.keys()): | ||
spec = importlib.util.spec_from_file_location(module_name, _planning_plugins[module_name]) | ||
module = importlib.util.module_from_spec(spec) | ||
spec.loader.exec_module(module) | ||
self.planning_constructs.append(module.Plugin(module_name,headers)) | ||
|
||
def update(self, curr_data, status): | ||
input_data = curr_data | ||
output_data = status_to_oneHot(status) | ||
for plugin in self.planning_constructs: | ||
plugin.update(input_data) | ||
|
||
def apriori_training(self, batch_data): | ||
for plugin in self.planning_constructs: | ||
plugin.apriori_training(batch_data) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Extra new lines |
||
def render_reasoning(self): | ||
diagnoses = {} | ||
for plugin in self.planning_constructs: | ||
diagnoses[plugin.component_name] = plugin.render_reasoning() | ||
return diagnoses | ||
|
||
|
||
|
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
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
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
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
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import twice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, it's done in learners_interface.py as well