Skip to main content

UBC Solar's Simulation Environment

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

UBC-Solar-Simulation-0.7.2.tar.gz (5.1 MB view details)

Uploaded Source

Built Distribution

UBC_Solar_Simulation-0.7.2-py3-none-any.whl (5.1 MB view details)

Uploaded Python 3

File details

Details for the file UBC-Solar-Simulation-0.7.2.tar.gz.

File metadata

  • Download URL: UBC-Solar-Simulation-0.7.2.tar.gz
  • Upload date:
  • Size: 5.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for UBC-Solar-Simulation-0.7.2.tar.gz
Algorithm Hash digest
SHA256 0b17af023921e14d48cff7927a809cd2b2b626ff23d8c86fb47ffe90088d16c3
MD5 af09202f2b594a7032630f856e14f7c5
BLAKE2b-256 f84f977805180c518a8fc310184d2586ba53628e76b64eace727e9cb1104a1df

See more details on using hashes here.

File details

Details for the file UBC_Solar_Simulation-0.7.2-py3-none-any.whl.

File metadata

File hashes

Hashes for UBC_Solar_Simulation-0.7.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8a0e128d4ff429a6bb72df2f2732593238d3580729b5521a615ff2630e72ae98
MD5 28b0e27ec9a10d49d38f0c60c4a02d3f
BLAKE2b-256 652522d43e4bf50635db525373056f8da2a54158c9f938db5998ca2243871525

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page