Revisions to make the how-to guides show in navigation pane
This commit is contained in:
@@ -17,6 +17,18 @@ What is PrimAITE?
|
||||
source/dependencies
|
||||
source/glossary
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 8
|
||||
:caption: How To
|
||||
:hidden:
|
||||
|
||||
source/how_to
|
||||
source/how_to_guides/custom_actions
|
||||
source/how_to_guides/custom_environments
|
||||
source/how_to_guides/custom_rewards
|
||||
source/how_to_guides/custom_software
|
||||
source/how_to_guides/using_dev_cli
|
||||
|
||||
.. toctree::
|
||||
:caption: Usage:
|
||||
:hidden:
|
||||
|
||||
10
docs/source/how_to.rst
Normal file
10
docs/source/how_to.rst
Normal file
@@ -0,0 +1,10 @@
|
||||
.. only:: comment
|
||||
|
||||
© Crown-owned copyright 2025, Defence Science and Technology Laboratory UK
|
||||
|
||||
How-To Guides
|
||||
=============
|
||||
|
||||
These how-to guides aim to provide a starting point for development within PrimAITE, creating your own custom components and environments for use when training agents. More detailed information for each section can be found within the documentation.
|
||||
|
||||
There are also some additional notebooks which provide a walkthrough of established content. It's encouraged to reference these when developing for PrimAITE.
|
||||
@@ -7,13 +7,15 @@
|
||||
Creating Custom Actions in PrimAITE
|
||||
***********************************
|
||||
|
||||
PrimAITE contains a selection of available actions that can be exercised within a training session, listed within ``actions.py``. `Note`: Agents are only able to perform the actions listed within it's action_map, defined within it's configuration YAML. See :ref:`custom_environment` for more information.
|
||||
PrimAITE contains a selection of possible actions that can be exercised within a training environment. Actions provided as a part of PrimAITE can be seen within `src/primaite/game/agent/actions`. `Note`: Agents are only able to perform the actions listed within it's action_map, defined within it's configuration YAML. See :ref:`custom_environment` for more information.
|
||||
|
||||
Developing Custom Actions
|
||||
============================
|
||||
=========================
|
||||
|
||||
Actions within PrimAITE follow a default format, as seen below and in ``actions.py``. It's important that they have an identifier when declared, as this is used when creating the training environment.
|
||||
|
||||
An example of a custom action is seen below, with key information about what is required for new actions in :ref:`extensible_actions`.
|
||||
|
||||
.. code:: Python
|
||||
|
||||
class ExampleActionClass(AbstractAction, identifier="ExampleActions"):
|
||||
@@ -24,7 +26,7 @@ Actions within PrimAITE follow a default format, as seen below and in ``actions.
|
||||
class ConfigSchema(AbstractAction.ConfigSchema)
|
||||
|
||||
node_name: str
|
||||
|
||||
|
||||
@classmethod
|
||||
def form_request(cls, config: ConfigSchema) -> RequestFormat:
|
||||
return [config.node_name, "example_action"]
|
||||
@@ -36,9 +38,9 @@ Any custom actions should then be added to the `ActionManager` class, and the `a
|
||||
|
||||
|
||||
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).
|
||||
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):
|
||||
|
||||
.. code:: Python
|
||||
|
||||
|
||||
@@ -25,7 +25,9 @@ You configuration file should follow the hierarchy seen below:
|
||||
simulation:
|
||||
...
|
||||
|
||||
MetaData Tag
|
||||
============
|
||||
|
||||
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`.
|
||||
|
||||
For detailed information about the remaining configuration items found within the configuration file, see :ref:`Configurable Items`.
|
||||
|
||||
@@ -12,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
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
Extensible Actions
|
||||
******************
|
||||
|
||||
|
||||
Changes to Actions class Structure.
|
||||
===================================
|
||||
|
||||
@@ -33,7 +32,7 @@ The ConfigSchema sub-class of the action must contain all `configurable` variabl
|
||||
|
||||
|
||||
Unique discriminator
|
||||
#################
|
||||
####################
|
||||
|
||||
When declaring a custom class, it must have a unique discriminator string, that allows PrimAITE to generate the correct action when needed.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user