- Python 3.8 or higher
- Mevea Simulation Software (Modeller and Solver)
- Mantsinen Model
- Playback files in .ob format
- Clone the repository:
git clone https://github.com/mizolotu/SmartMantsinen
- From SmartMantsinen directory, install required python packages (it is obviously recommended to create a new virtualenv and install everything there):
python -m pip install -r requirements.txt
-
Open Mevea Modeller and load Mantsinen Model. Go to Scripting -> Scripts, create a new script object, select
env_backend.py
from SmartMantsinen directory as the file name in the object view. Go to I/O -> Inputs -> AI_Machine_Bus_Aux1_RPDO1_u16Y49_BoomLc (or any other input component) and select the object just created as the script name. -
In terminal, navigate to the Mevea Software resources directory (default: C:\Program Files (x86)\Mevea\Resources\Python\Bin) and install numpy and requests:
python -m pip install numpy requests --no-cache-dir
-
Open Mevea Solver, go to Settings, and enable automatic start. Close the solver.
-
Open file
config.py
, and change path to Mantsinen model. Change other settings if needed.
- From SmartMantsinen directory start the server script:
bash python env_server.py
- Replay
.ob
file to record the trajectory data into.csv
:
python process_trajectory.py -o <output_file>
- Find minimum and maximum data values for output and reward signals:
python standardize_data.py
- From SmartMantsinen directory start the server script, if it has not yet been started:
python env_server.py
- Start or continue training the PPO agent:
python train_ppo.py
- Plot reward evolution:
python plot_results.py
- Demonstrate the policy trained:
python demonstrate_ppo.py -w <text file with waypoints> -c <first, last or best>
The first checkpoint corresponds to the model pretrained with supervised learning.
Model evaluation:
- supervised (behavioral clonning): https://drive.google.com/file/d/12U97PRpldCd-K9r5iUCOpqb3AXWIF9ii/view?usp=sharing
- supervised + reinforcement (transfer learning): https://drive.google.com/file/d/1Nu2yP3NV7r-1gkglhPLMniJfUfGvj8oq/view?usp=sharing