Merged PR 105: Fix errors while trying to run Hardcoded agent
## Summary Since we added File System State as a new part of the observation space, some of the assumptions made by imported ADSP code were not met. This is addressed by these changes. The code no longer crashes, but the hardcoded ACL agent doesn't work very well, it keeps returning action 0 and receives a low reward. Also if there are ACL rules with 'ANY' as a source IP, it crashes the function `get_node_of_ip` within the HardCodedACLAgent._calculate_action_full_view() method. I'm not sure how much effort we need to spend fixing the hardcoded agents as they don't seem like they were delivered in a finished state. ## Test process Can confirm the hardcoded agent can run within a primaite session now. ## Checklist - [x] This PR is linked to a **work item** - [x] I have performed **self-review** of the code - [ ] I have written **tests** for any new functionality added with this PR - [ ] I have updated the **documentation** if this PR changes or adds functionality - [x] I have run **pre-commit** checks for code style ## note I would appreciate some input about what we should do with hardcoded agents for release 2.0.0, it may require significant effort to get them working correctly. Related work items: #1587
This commit is contained in:
@@ -184,7 +184,6 @@ def transform_change_obs_readable(obs: np.ndarray) -> List[List[Union[str, int]]
|
||||
os_states = [SoftwareState(i).name for i in obs[:, 2]]
|
||||
new_obs = [ids, operating_states, os_states]
|
||||
|
||||
# changed range(3,...) to range(4,...) because we added file system which was new since ADSP
|
||||
for service in range(4, obs.shape[1]):
|
||||
# Links bit/s don't have a service state
|
||||
service_states = [SoftwareState(i).name if i <= 4 else i for i in obs[:, service]]
|
||||
|
||||
Reference in New Issue
Block a user