-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This change is still in process. Added a few stubs, but need to have …
…an architecure discussion still
- Loading branch information
Evana Gizzi
authored and
Evana Gizzi
committed
Oct 12, 2023
1 parent
6279476
commit f5dc9cc
Showing
3 changed files
with
45 additions
and
1 deletion.
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
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,39 @@ | ||
# 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" | ||
|
||
""" | ||
Reasoning interface class for managing all complex custom reasoning components | ||
""" | ||
import importlib.util | ||
|
||
from ..util.data_conversion import * | ||
|
||
class ComplexReasoningInterface: | ||
def __init__(self, headers, _reasoning_plugins={}): | ||
assert(len(headers)>0), 'Headers are required' | ||
self.headers = headers | ||
self.reasoning_constructs = [] | ||
for module_name in list(_reasoning_plugins.keys()): | ||
spec = importlib.util.spec_from_file_location(module_name, _reasoning_plugins[module_name]) | ||
module = importlib.util.module_from_spec(spec) | ||
spec.loader.exec_module(module) | ||
self.reasoning_constructs.append(module.Plugin(module_name,headers)) | ||
|
||
def update(self, low_level_data, high_level_data): | ||
for plugin in self.reasoning_constructs: | ||
plugin.update(low_level_data,high_level_data) | ||
|
||
def check_for_salient_event(self): | ||
pass | ||
|
||
def render_reasoning(self): | ||
intelligent_outcomes = {} | ||
for plugin in self.reasoning_constructs: | ||
intelligent_outcomes[plugin.component_name] = plugin.render_reasoning() | ||
return intelligent_outcomes |
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