Skip to main content

UBC Solar's ASC and FSGP Simulation

Build Status

Welcome to UBC Solar's race strategy simulation environment! The objective of this simulation is to guide UBC Solar's race strategy by creating a model to predict the performance of the UBC Solar cars in the American Solar Challenge (ASC) and Formula Sun Grand Prix (FSGP).

This document contains information on how to get setup with the Simulation framework.

For more detailed information on the inner workings of the simulation please refer to the wiki.

Getting started

Prerequisites

Open up your terminal/command prompt and execute the following commands to check your installations.

  • Ensure you have Git installed by running:
git --version

The above command should return a version number if you have Git installed.

  • Check your Python installation by running:
python --version

NOTE: Any Python version before 3.8 is not supported so please make sure that your Python version is in the format 3.8.x or above.

Installation

  • Clone the simulation repository into any directory of your choosing by running:

    git clone https://github.com/UBC-Solar/Simulation.git
    
  • You should now have a "Simulation" folder inside your chosen directory. To enter the "Simulation" folder run:

    cd Simulation
    
  • To install the simulation package, run the following:

    pip install .
    

    If the above command doesn't work, try the one below:

    pip3 install .
    

    If neither work, you either do not have pip installed or are not in the correct directory.

  • Next, run the build command to complete the build which will attempt to compile a few libraries to improve performance.

    build_simulation
    

    You can also run the script directly by navigating to the "Simulation" project root directory.

    python build.py
    

    If the above command doesn't work, try the one below:

    python3 build.py
    
  • If all the commands worked, you should then be able to run the command simulation_health_check, which will ensure everything is working properly.

simulation_health_check

You should see a dump of information ending with a "Simulation was successful!", indicating that everything worked properly.

Run Simulation

To run Simulation, you can run the command run_simulation. This section covers command-line usage; to use Simulation as a part of a project, review the wiki.

run_simulation

Windows

Or, you can run the script directly. Before running the following commands make sure you have navigated to the "Simulation" directory. Please note support those in examples and examples/archive has discontinued.

Unix

python3 simulation/run_simulation.py

Windows

python .\simulation\run_simulation.py

Arguments

In both cases, you can pass a set of execution parameters. You can view a list of valid arguments and settings that Simulation can accept with the -help command.

Unix

python3 simulation/run_simulation.py -help

Windows

python .\simulation\run_simulation.py -help

Testing

To run the pre-written tests and ensure the simulation package is functioning correctly, navigate to the "Simulation" folder on your terminal, and run:

pytest

To run the tests and show the test coverage, do

pip install pytest-cov
pytest --cov=simulation tests/

If your terminal returns something like "pytest is not recognized as an internal or external command...", install PyTest by executing the following:

pip install -U pytest

Or:

pip3 install -U pytest

Metadata

Release files for UBC-Solar-Simulation 0.7.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for UBC-Solar-Simulation 0.7.2
File Size Uploaded
UBC-Solar-Simulation-0.7.2.tar.gz 5.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for UBC-Solar-Simulation 0.7.2
File Interpreter ABI Platform
UBC_Solar_Simulation-0.7.2-py3-none-any.whl Python 3 none any Details

Total release size: 10.1 MB

Release files / UBC-Solar-Simulation-0.7.2.tar.gz

Download URL UBC-Solar-Simulation-0.7.2.tar.gz
Size 5.1 MB
Tags Source
SHA-256 checksum
How to use checksums
0b17af023921e14d48cff7927a809cd2b2b626ff23d8c86fb47ffe90088d16c3
BLAKE2b-256 checksum
How to use checksums
f84f977805180c518a8fc310184d2586ba53628e76b64eace727e9cb1104a1df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / UBC_Solar_Simulation-0.7.2-py3-none-any.whl

Download URL UBC_Solar_Simulation-0.7.2-py3-none-any.whl
Size 5.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
8a0e128d4ff429a6bb72df2f2732593238d3580729b5521a615ff2630e72ae98
BLAKE2b-256 checksum
How to use checksums
652522d43e4bf50635db525373056f8da2a54158c9f938db5998ca2243871525
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page