Updates to documentation pages
This commit is contained in:
@@ -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).
|
||||
|
||||
|
||||
@@ -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`.
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
© Crown-owned copyright 2025, Defence Science and Technology Laboratory UK
|
||||
|
||||
.. _custom_software:
|
||||
|
||||
Creating Custom Software for PrimAITE
|
||||
*************************************
|
||||
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
© Crown-owned copyright 2025, Defence Science and Technology Laboratory UK
|
||||
|
||||
.. _about:
|
||||
.. _extensible_agents:
|
||||
|
||||
Extensible Agents
|
||||
*****************
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
© Crown-owned copyright 2025, Defence Science and Technology Laboratory UK
|
||||
|
||||
.. _about:
|
||||
.. _extensible_nodes:
|
||||
|
||||
|
||||
Extensible Nodes
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
© Crown-owned copyright 2025, Defence Science and Technology Laboratory UK
|
||||
|
||||
.. _about:
|
||||
.. _extensible_rewards:
|
||||
|
||||
Extensible Rewards
|
||||
******************
|
||||
|
||||
@@ -1688,7 +1688,7 @@
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.10.12"
|
||||
"version": "3.10.11"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
||||
Reference in New Issue
Block a user