This library contains the projects ControlComponents.Core, ControlComponents.ML and ControlComponent.Frame.
-
ControlComponents.Core provides basic functionality to create ControlComponents as defined in BaSyx.
-
ControlComponents.ML provides basic functionality to extend ControlComponents with Reinforcement Learning specific interfaces.
-
ControlComponents.Frame provides the FrameControlComponent, which can be used to extract operation modes and use those in a different component. The relevant states and calls are synchronized between those two components.
This library supports netstandard2.0 to be used in Unity3D.
Compile the project by running dotnet build
Use the resulting .dll files in your project to access control component feature of this library.
By extending the OperationMode class and overriding the state specific methods, you can inject your own logic and encapsulate it in a BaSys ControlComponent. Create or extend the ControlComponent class and pass OperationModes and OrderOutputs to it.
To use an OrderOutput you have three options:
- Pass a ControlComponent to the using ControlComponent on creation. In the constructor you can then create an Orderoutput with that ControlComponent.
- Pass the is of a ControlComponent to the using ControlComponent. In the constructor you can then create an Orderoutput and configure it via a IControlComponentProvider.
- Pass an already configured or not configured OrderOutput to the ControlComponent on creation. This is the best method if FrameControlComponents should be used.
You can find an example here in the PTS.ControlComponents project.
- Prepare VSCode https://code.visualstudio.com/docs/languages/dotnet
- Follow this Project Structure
- You can use the dotnet cli to create new projects
- Try to implement specific, small and tested features. Create a pull request.
This project uses NUnit.
Run the following command to execute tests (dotnet test reference).
dotnet test
Using the following command creates a TestResult folder with the coverage results (coverage reference):
dotnet test --collect:"XPlat Code Coverage"
install reportgenerator to generate a test report. dotnet tool install -g dotnet-reportgenerator-globaltool
.
Run the following command (with the correct result id) to create a "coveragereport" folder with an index.html file to present the coverage results:
reportgenerator -reports:.\tests\ControlComponents.Core.Tests\TestResults\58238ace-ffed-4f17-8afa-d9a60792f957\coverage.cobertura.xml -targetdir:coveragereport -reporttypes:Html
Open the index.html file in your browser to access the results.
- Moq to provide Mock and Stub functionality
- coverlet.collector to provide test coverage plugin https://github.com/coverlet-coverage/coverlet/blob/master/README.md https://docs.microsoft.com/de-de/dotnet/core/testing/unit-testing-code-coverage?tabs=windows