Updates to documentation pages

This commit is contained in:
Charlie Crane
2025-02-26 12:03:00 +00:00
parent 7ec664ae67
commit 0d93981ef8
8 changed files with 27 additions and 12 deletions

View File

@@ -2,7 +2,7 @@
© Crown-owned copyright 2025, Defence Science and Technology Laboratory UK
.. _custom_action:
.. _custom_actions:
Creating Custom Actions in PrimAITE
***********************************
@@ -19,18 +19,24 @@ Actions within PrimAITE follow a default format, as seen below and in ``actions.
class ExampleActionClass(AbstractAction, identifier="ExampleActions"):
"""Example Action Class"""
def __init__(self, manager: "ActionManager", num_nodes: int, num_folders: int, **kwargs) -> None:
super().__init(manager, num_nodes=num_nodes, num_folders=num_folders, **kwargs)
self.verb: str = "ExampleAction"
config: ExampleAction.ConfigSchema(AbstractAction.ConfigSchema)
class ConfigSchema(AbstractAction.ConfigSchema)
node_name: str
@classmethod
def form_request(cls, config: ConfigSchema) -> RequestFormat:
return [config.node_name, "example_action"]
Integration with PrimAITE ActionManager
==========================================
=======================================
Any custom actions should then be added to the `ActionManager` class, and the `act_class_identifiers` dictionary. This will map the action class to the corresponding action type string that would be passed through the PrimAITE `request_system`.
Interaction with the PrimAITE Request Manager
================================================
==============================================
Where an action would cause a request to be sent through the PrimAITE RequestManager, a `form_request` method is expected to be defined within the Action Class. This should format the action into a format that can be ingested by the `RequestManager`. Examples of this include the `NodeFolderCreateAction`, which sends a formed request to create a folder on a given node (seen below).

View File

@@ -2,7 +2,7 @@
© Crown-owned copyright 2025, Defence Science and Technology Laboratory UK
.. _custom_environment:
.. _custom_environments:
Creating Custom Environments for PrimAITE
*****************************************
@@ -13,6 +13,9 @@ You configuration file should follow the hierarchy seen below:
.. code:: yaml
metadata:
version: 4.0
io_settings:
...
game:
@@ -22,5 +25,7 @@ You configuration file should follow the hierarchy seen below:
simulation:
...
It's important to include the metadata tag within your YAML file, as this is used to ensure PrimAITE can interpret the configuration correctly. This should also include any plugins that are required for the defined environment, along with their respective version.
For detailed information about each configuration item found within the configuration file, see :ref:`Configurable Items`.

View File

@@ -2,6 +2,8 @@
© Crown-owned copyright 2025, Defence Science and Technology Laboratory UK
.. _custom_software:
Creating Custom Software for PrimAITE
*************************************
@@ -10,7 +12,7 @@ This page aims to provide a how-to guide on how to create your own custom softwa
PrimAITE has a base software class which should be inherited from when building custom software. Examples of this can be seen in the ``IOSoftware`` and ``Process`` classes.
It's important that any new software created within PrimAITE has the ``identifier`` attribute defined, for use when generating the environment.
Some default attributes may need to be adjusted to align with the intended application of the custom software.
Some default attributes may need to be adjusted to align with the intended application of the custom software.
.. code:: Python

View File

@@ -2,6 +2,7 @@
© Crown-owned copyright 2025, Defence Science and Technology Laboratory UK
.. _extensible_actions:
Extensible Actions
******************
@@ -48,6 +49,7 @@ When declaring a custom class, it must have a unique discriminator string, that
node_name: str
directory_name: str
@classmethod
def form_request(cls, config: ConfigSchema) -> RequestFormat:
return ["network",
"node",

View File

@@ -2,7 +2,7 @@
© Crown-owned copyright 2025, Defence Science and Technology Laboratory UK
.. _about:
.. _extensible_agents:
Extensible Agents
*****************

View File

@@ -2,7 +2,7 @@
© Crown-owned copyright 2025, Defence Science and Technology Laboratory UK
.. _about:
.. _extensible_nodes:
Extensible Nodes

View File

@@ -2,7 +2,7 @@
© Crown-owned copyright 2025, Defence Science and Technology Laboratory UK
.. _about:
.. _extensible_rewards:
Extensible Rewards
******************

View File

@@ -1688,7 +1688,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
"version": "3.10.11"
}
},
"nbformat": 4,