Commit Graph

1378 Commits

Author SHA1 Message Date
Marek Wolan
8a9d8fb17c Calm logging again 2024-03-15 14:10:34 +00:00
Marek Wolan
7f4f3e9bfe Calm logging 2024-03-15 14:09:02 +00:00
Marek Wolan
c8beb39fac clear notebook output 2024-03-15 14:03:49 +00:00
Marek Wolan
33dd6e4dcd Make sure notebook is using correct dict key 2024-03-15 14:03:37 +00:00
Marek Wolan
d9b6506572 Mention python version in getting started guide. 2024-03-15 13:42:59 +00:00
Marek Wolan
6ce96f00fe Merge branch 'feature/2369-document-how-to-use-primaite-notebooks' of https://dev.azure.com/ma-dev-uk/PrimAITE/_git/PrimAITE into feature/2369-document-how-to-use-primaite-notebooks 2024-03-15 13:25:54 +00:00
Marek Wolan
2fde071789 Update docs on example notebooks 2024-03-15 13:25:50 +00:00
Marek Wolan
505f9dfb09 Merge remote-tracking branch 'origin/dev' into feature/2369-document-how-to-use-primaite-notebooks 2024-03-15 13:25:30 +00:00
Czar Echavez
e580fa0464 Merge remote-tracking branch 'origin/dev' into feature/2369-document-how-to-use-primaite-notebooks 2024-03-15 13:14:31 +00:00
Czar Echavez
1ed2f48f54 #2369: missed items 2024-03-15 13:13:54 +00:00
Marek Wolan
d257501703 Merged PR 304: Reward sharing
## Summary
* add ability for agents to share rewards - the calculated reward value for one agent can be used as a component of another agent's reward.
* Update UC2 configs to use the reward sharing functionality - green agents have a reward based on their two actions. Blue agent reward adds green agent rewards to itself.
* Add agent action history - This allows the rewards to react to agent actions.
* Make action logging use the new agent history.
* Make the webpage and database reward components treat failed requests the same as if the webpage was unavailable / database was unreachable.
* reorder the PrimaiteGame step to be the same as the Gymnasium env step
* update uc2 notebook accordingly.

## Test process
Tested with ad-hoc notebooks and debugging tool to verify correct data is being used. Tested notebooks run properly and pytests pass. Added unit and integration tests.

## Checklist
- [ ] PR is linked to a **work item**
- [ ] **acceptance criteria** of linked ticket are met
- [ ] performed **self-review** of the code
- [ ] written **tests** for any new functionality added with this PR
- [ ] updated the **documentation** if this PR changes or adds functionality
- [ ] written/updated **design docs** if this PR implements new functionality
- [ ] updated the **change log**
- [ ] ran **pre-commit** checks for code style
- [ ] attended to any **TO-DOs** left in the code

Related work items: #2372
2024-03-15 10:42:12 +00:00
Marek Wolan
a9bf0981e6 Doc fixes 2024-03-15 09:22:55 +00:00
Czar Echavez
1d09f0791a #2369: Reduce dependency on manually replacing primaite version across documentation 2024-03-14 23:17:34 +00:00
Czar Echavez
88a3c42f2f #2369: commiting work done so far 2024-03-14 22:15:27 +00:00
Marek Wolan
d33c80d0d6 Minor fixes 2024-03-14 14:33:04 +00:00
Marek Wolan
f438acf745 Add shared reward test 2024-03-13 14:01:17 +00:00
Marek Wolan
ee26554ef0 merge origin/dev into feature branch 2024-03-13 12:11:50 +00:00
Marek Wolan
10ee9b300f Update docs on rewards 2024-03-13 12:08:20 +00:00
Czar Echavez
c7c34e1fb6 Merged PR 301: #2350: Confirm action / observation space conforms to CAOS v0.7
## Summary
### **work related to v0.7 CAOS**
- Split observations.py into:
  - agent_observations.py
  - file_system_observations.py
  - node_observations.py
  - nic_observations.py
  - observation_manager.py
  - observations.py
  - software_observations.py
- added tests to ensure that the observations align with [QTSL-820-2450 - ARCD Track 2 Common Action Observation Space Definition v0.7](https://nscuk.sharepoint.com//r/sites/SSE32ARCDIDT/Shared%20Documents/General/ARCD/Architecture%20%26%20Design%20Documentation/Common/CAOS%20Related%20Documents/QTSL-820-2450%20-%20ARCD%20Track%202%20Common%20Action%20Observation%20Space%20Definition%20v0.7.xlsx?d=wee5713d8640b4b5bb3cb5624936e417e&csf=1&web=1&e=lByVQ5)

### preparation for v0.8 CAOS
WILL NOT AFFECT OBSERVATION SPACE FOR V0.7

**DO NOT PANIC**

these features are needed for v0.8

- integrated `num_access` to file (not used yet in file observations)
- integrated `num_file_deletions` and `num_file_creations` to file_system (not used yet in node observations)

## Test process
*How have you tested this (if applicable)?*

## Checklist
- [X] PR is linked to a **work item**
- [X] **acceptance criteria** of linked ticket are met
- [X] performed **self-review** of the code
- [X] written **tests** for any new functionality added with this PR
- [ ] updated the **documentation** if this PR changes or adds functionality
- [ ] written/updated **design docs** if this PR implements new functionality
- [ ] updated the **change log**
- [X] ran **pre-commit** checks for code style
- [ ] attended to any **TO-DOs** left in the code

Related work items: #2350
2024-03-13 09:20:23 +00:00
Marek Wolan
6dedb91099 Remove redundant TODOs 2024-03-13 09:17:29 +00:00
Czar Echavez
f2c6f10c21 #2350: apply PR suggestions 2024-03-12 12:20:02 +00:00
Marek Wolan
045f467407 Update marl config 2024-03-12 11:51:17 +00:00
Marek Wolan
24fdb8dc17 Fix minor reward sharing bugs 2024-03-12 11:40:26 +00:00
Marek Wolan
03ee976a2d remove extra print statement 2024-03-12 11:00:55 +00:00
Marek Wolan
a76f5b0efb Merge remote-tracking branch 'origin/dev' into feature/2327-green-action-failure-part-II 2024-03-12 10:59:41 +00:00
Czar Echavez
ec4818e4d3 Merge remote-tracking branch 'origin/dev' into feature/2350-confirm-action-observation-space-conforms-to-CAOS-0.7 2024-03-12 09:11:30 +00:00
Marek Wolan
c3f1cfb33d Add shared reward 2024-03-11 22:53:39 +00:00
Marek Wolan
7599655879 Add agent action history 2024-03-11 20:10:08 +00:00
Marek Wolan
f46980b5f5 Merged PR 302: Make simulator requests able to provide a response
this PR is a pre-requisite to the work im doing today where green agents actions that fail to reach their target still incur a negative reward.

## Summary
- Requests now return a response.
- Added the request response to the agent logging and info output of env step.
- Changed all request types in the simulator to return a response
- Added a new 'validator' that allows nodes to execute actions only if the node is on (this check happens at the request level rather than in every single function)
- Fixed NMNE - made nic observation responsible for converting total NMNE this episode to NMNE last step because apply_timestep is applied after actions but before observations in the step method.
- Fixed arcd_uc2_network to configure the db clients and web browsers correctly
- Added tests for request responses

## Test process
New tests, existing tests pass.

## Checklist
- [x] PR is linked to a **work item**
- [x] **acceptance criteria** of linked ticket are met
- [x] performed **self-review** of the code
- [x] written **tests** for any new functionality added with this PR
- [X] updated the **documentation** if this PR changes or adds functionality
- [ ] written/updated **design docs** if this PR implements new functionality
- [ ] updated the **change log**
- [x] ran **pre-commit** checks for code style
- [x] attended to any **TO-DOs** left in the code

Related work items: #2372
2024-03-11 19:48:18 +00:00
Czar Echavez
cd6d6325db #2350: add tests to check spaces + acl obs test + nmne space changes 2024-03-11 17:47:33 +00:00
Marek Wolan
1faefbccac Add docstring for init request manager 2024-03-11 10:20:47 +00:00
Marek Wolan
66ab5ec980 Fix last tests 2024-03-11 09:18:31 +00:00
Czar Echavez
a228a09917 #2350: documentation 2024-03-10 15:13:37 +00:00
Marek Wolan
d2afcaa939 Update changelog 2024-03-10 13:06:45 +00:00
Marek Wolan
e5c5a85003 Add docs on request response 2024-03-10 13:05:57 +00:00
Marek Wolan
f4684b0349 Fix how nmnes are getting put into obs space. 2024-03-09 23:32:00 +00:00
Marek Wolan
359777f4f8 Add tests for request success/fail 2024-03-09 23:06:53 +00:00
Marek Wolan
31ae4672ac Make nodes only accept requests when they're on 2024-03-09 20:47:57 +00:00
Czar Echavez
cc721056d8 #2350: configurable NMNE category thresholds 2024-03-08 19:32:07 +00:00
Marek Wolan
289b5c548a Make a type alias for request & fix typo 2024-03-08 17:14:41 +00:00
Marek Wolan
0447a05084 Add call validation 2024-03-08 15:57:43 +00:00
Marek Wolan
beb51834f9 Make all requests return a RequestResponse 2024-03-08 14:58:34 +00:00
Czar Echavez
61aa242128 #2350: tests + application 2024-03-08 14:48:31 +00:00
Czar Echavez
ba58204542 #2350: split observations into smaller files 2024-03-08 14:08:35 +00:00
Czar Echavez
b13725721d #2350: splitting observations into separate files 2024-03-08 13:49:00 +00:00
Marek Wolan
d331224b45 Start introducing RequestResponse 2024-03-08 12:42:22 +00:00
Czar Echavez
e9eef2b4c0 #2350: add num_access, num_file_deletions and num_creations to file system 2024-03-08 11:16:27 +00:00
Marek Wolan
59bbc0e733 Merged PR 299: Match default reward configs to Imaginary Yak.
## Summary
Change the default rewards for the data manipulation configs
Also I renamed the config files to make their names more descriptive.

## Test process
Pytests and all notebooks run without fail.

## Checklist
- [x] PR is linked to a **work item**
- [x] **acceptance criteria** of linked ticket are met
- [x] performed **self-review** of the code
- [ ] written **tests** for any new functionality added with this PR
- [ ] updated the **documentation** if this PR changes or adds functionality
- [ ] written/updated **design docs** if this PR implements new functionality
- [ ] updated the **change log**
- [x] ran **pre-commit** checks for code style
- [x] attended to any **TO-DOs** left in the code

Related work items: #2365
2024-03-07 21:52:55 +00:00
Marek Wolan
81a375d6c4 Merged PR 298: Update NMNE to only count MNEs in the last step.
## Summary
The NMNE counts MNEs since last step rather than since last episode.

## Test process
Updated unit tests to check for the new behaviour and added new test.

## Checklist
- [x] PR is linked to a **work item**
- [x] **acceptance criteria** of linked ticket are met
- [x] performed **self-review** of the code
- [x] written **tests** for any new functionality added with this PR
- [x] updated the **documentation** if this PR changes or adds functionality
- [ ] written/updated **design docs** if this PR implements new functionality
- [x] updated the **change log**
- [x] ran **pre-commit** checks for code style
- [x] attended to any **TO-DOs** left in the code

There's no update necessary to the docs or change log because it NMNE is already documented, and the text is still correct given this minor change.

Related work items: #2348
2024-03-07 16:20:39 +00:00
Marek Wolan
618da8abe9 Rename notebooks 2024-03-07 15:25:11 +00:00