scenario_BasicOrbitMultiSat_MT
Overview
This script demonstrates how to use the Basilisk v2.1 multi-threading to simulate a constellation of 16 spacecraft using 4 threads. The simulation scenario setup is very similar to scenario_BasicOrbitMultiSat. To setup the unique satellite orbits, the script here loops over all satellites an incrementally changes the orbit elements. The following Vizard screen capture illustrate the family of orbits being simulated.
Inside the run()
command the number of threads is specified using:
TheScenario.TotalSim.resetThreads(numThreads)
With this basic setup it is assumed that each BSK process can run independently in a thread. Note that this script does not use any spacecraft flight software which is running in a separate process. The Basilisk v2.1 multi-threading only functions for simulations where each Basilisk process can be evaluated independently.
Warning
The Basilisk v2.1 multi-threading does not have a thread-safe messaging system. This will be added in a later release.
Illustration of Simulation Results
showPlots = True, numberSpacecraft=16, environment = 'Earth', numThreads = 4
- scenario_BasicOrbitMultiSat_MT.run(show_plots, numberSpacecraft, environment, numThreads)[source]
The scenarios can be run with the followings setups parameters:
- Parameters:
show_plots (bool) – Determines if the script should display plots
numberSpacecraft (int) – Number of spacecraft in the simulation
environment (string) – Chooses which environment to set the simulation in. Options are “Earth” or “Mercury”
numThreads (int) – number of threads