Commit Graph

1349 Commits

Author SHA1 Message Date
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
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
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
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
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
Marek Wolan
d331224b45 Start introducing RequestResponse 2024-03-08 12:42:22 +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
Marek Wolan
76752fd9af Change the nmne clear to happen at apply_timestep instead of within describe_state 2024-03-07 14:44:44 +00:00
Marek Wolan
17d4807660 Rename configs 2024-03-07 14:33:21 +00:00
Marek Wolan
2547361daf Change default reward weights 2024-03-07 13:52:26 +00:00
Marek Wolan
a900d59f7b Update NMNE to only count MNEs in the last step. 2024-03-07 12:15:30 +00:00
Marek Wolan
8589ce449a Merged PR 295: Agent action logging
## Summary
Added a new optional capability to create a JSON log each episode with a list of action each agent took each step (including scripted, RL, and red agents).

Also I had to slightly refactor the IO system to not rely on PrimaiteSession, as it's gonna be deprecated soon. Therefore the IO module is now linked to the gym environment. Each time you init a gym environment, it creates a session directory.

## Test process
Tried the SB3, Ray SARL and Ray MARL notebooks to see that the outputs get generated.

## 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
- [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

Move IO to environments from session and add agent logging

Related work items: #2278
2024-03-05 16:39:44 +00:00
Marek Wolan
e117f94f43 Minor doc fix 2024-03-05 15:46:30 +00:00
Marek Wolan
72e0c3b402 Merged PR 296: Add a notebook to customise red agent behaviour
## Summary
just run the notebook and see if the explanation makes sense.

I also renamed some stuff to make it more user friendly

Related work items: #2343
2024-03-05 12:02:19 +00:00
Marek Wolan
a7bfc56b98 Apply documentation changes based on PR review. 2024-03-05 11:21:49 +00:00
Marek Wolan
3e495c4622 Cosmetic changes to notebook 2024-03-05 09:28:22 +00:00
Marek Wolan
758f892b74 Make notebook for varying red agent behaviour in uc2 2024-03-04 21:04:27 +00:00
Marek Wolan
a222a8c58f Give the UC2 config load function a meaningful name 2024-03-04 19:43:51 +00:00
Marek Wolan
1e8dfa40cf Give uc2 notebook a meaningful name 2024-03-04 19:36:54 +00:00
Marek Wolan
d0225bf3e1 Merge remote-tracking branch 'origin/dev' into feature/2278-log-agent-actions 2024-03-04 19:00:03 +00:00
Marek Wolan
c3010ff816 Update changelog and docs 2024-03-04 18:59:03 +00:00
Marek Wolan
2f456e7ae0 Move IO to environments from session and add agent logging 2024-03-04 18:47:50 +00:00
Marek Wolan
84f5d45540 Merged PR 294: Update actions set in uc2 to match Yak
## Summary
Expand the available actions.

## 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

Related work items: #2243
2024-03-04 14:39:07 +00:00
Marek Wolan
bc830e6458 Merge remote-tracking branch 'origin/dev' into feature/2243-sync-uc2-action-to-iy 2024-03-04 13:39:22 +00:00
Marek Wolan
c32bd3f941 Merged PR 285: Green agent that sometimes performs database connections
## Summary
* removed `GreenWebBrowsingAgent` because it was replaced by probabilistic agent
* created new 'probabilistic agent' which selects actions randomly from its action map, with configurable probabilities
* slightly refactored action manager to decouple it from `PrimaiteGame` (as a consequence, agents should be given the current timestep if their `get_action()` method is time-dependent)
* refactored `data_manipulation_bot` to use an existing db client on the host rather than inheriting from it
* added new type of SQL query to databases: `"SELECT * FROM pg_stat_activity"` to model checking connection status
* added new execution definition on the `DatabaseClient` app which just performs that new SQL query
* added reward for the green admin being able to connect to the db
* updated uc2 notebook to reflect new changes.
* updated documentation for data manipulation bot
* added new test for probabilistic agent
* added test for new reward

## 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

Related work items: #2319
2024-03-04 12:06:55 +00:00
Marek Wolan
2c3652979b Add helpful error messages to action index errors 2024-03-04 11:17:54 +00:00
Marek Wolan
ac9d550e9b Change get_action signature for agents 2024-03-04 10:43:38 +00:00
Marek Wolan
d1480e4477 Apply suggestions from PR review. 2024-03-04 09:58:57 +00:00
Marek Wolan
0d490d618c Update MARL config 2024-03-03 16:59:14 +00:00
Marek Wolan
a4c723858b Update action map in second 2024-03-03 16:57:53 +00:00
Marek Wolan
afc3635bfe Update changelog 2024-03-03 16:56:52 +00:00
Marek Wolan
ea1d016bc2 Merge remote-tracking branch 'origin/feature/2319-database-admin' into feature/2243-sync-uc2-action-to-iy 2024-03-03 16:55:42 +00:00
Marek Wolan
0e8c60df4c Update actions 2024-03-03 16:53:18 +00:00
Marek Wolan
a6031d568d Remove unused import 2024-03-03 16:36:08 +00:00
Marek Wolan
ef1a2dc3f4 clear uc2 notebook outputs 2024-03-03 16:00:10 +00:00
Marek Wolan
afa775baff Add test for new reward 2024-03-03 15:52:34 +00:00