Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ RUN apt-get update \
# install prerequesites for ortools
RUN apt-get update && \
apt-get -y install --no-install-recommends \
openjdk-8-jre \
openjdk-11-jre \
git \
&& \
: "remove cache" && \
apt-get autoremove -y -qq && \
Expand All @@ -22,11 +23,17 @@ RUN apt-get update && \
COPY . /ortools
WORKDIR /ortools

# install orhelper fork
RUN mkdir /projects && cd /projects && \
git clone https://github.com/SpaceTeam/orhelper.git && \
cd orhelper && \
pip install -e .

# install ortools
RUN pip install -e .

# get OR
RUN wget https://github.com/openrocket/openrocket/releases/download/release-15.03/OpenRocket-15.03.jar
RUN wget https://github.com/openrocket/openrocket/releases/download/release-22.02/OpenRocket-22.02.jar

# default command
CMD diana -c examples/dispersion_analysis.ini
22 changes: 11 additions & 11 deletions src/ortools/dispersion_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

from shapely.geometry import Point, Polygon

DIANA_RELEASE = "1.2.0"
DIANA_RELEASE = "1.3.0"

# -- plot options
plt.style.use("default")
Expand Down Expand Up @@ -163,7 +163,7 @@ def diana(directory, filename, config, output,
options.getLaunchAltitude())
logging.info("Launch Point {} found.".format(launch_point))

rocket = options.getRocket()
rocket = sim.getRocket()
num_stages = rocket.getChildCount()
print("Rocket has {} stage(s):".format(num_stages))
stage_names = [r.getName() for r in rocket.getChildren()]
Expand Down Expand Up @@ -331,8 +331,8 @@ def set_up_random_parameters(orh, sim, config):
Cside_factor_stddev = float(config["Aerodynamics"]["CsideFactor"])
CN_factor_stddev = float(config["Aerodynamics"]["CNFactor"])

mcid = options.getMotorConfigurationID()
rocket = options.getRocket()
rocket = sim.getRocket()
mcid = sim.getFlightConfigurationId()
num_stages = rocket.getChildCount()
stages = []
stage_separation_delays_max = []
Expand All @@ -357,7 +357,7 @@ def set_up_random_parameters(orh, sim, config):
stage_separation_delays_min.append(separationDelay)

# MassCalculation
refLen = rocket.getReferenceType().getReferenceLength(sim.getConfiguration())
refLen = rocket.getReferenceType().getReferenceLength(sim.getActiveConfiguration())
if (config.has_section("MassCalculation")):
if(config.has_option(
"MassCalculation", "CG")):
Expand Down Expand Up @@ -545,10 +545,10 @@ def randomize_simulation(open_rocket_helper, sim, rocket_components,
options.setLaunchIntoWind(False)
options.setLaunchRodDirection(azimuth_result)

mcid = options.getMotorConfigurationID()
rocket = options.getRocket()
mcid = options.getFlightConfigurationId()
rocket = sim.getRocket()
num_stages = rocket.getChildCount()
# set stage sepration
# set stage separation
for (
stage,
stage_separation_delay) in zip(
Expand Down Expand Up @@ -663,8 +663,8 @@ def get_simulation_parameters(open_rocket_helper, sim, rocket_components,
logging.info("CN factor = {:6.2f}".format(CN_factor))
logging.info("Cside factor = {:6.2f}".format(Cside_factor))

mcid = options.getMotorConfigurationID()
rocket = options.getRocket()
mcid = options.getFlightConfigurationId()
rocket = sim.getRocket()

# stage sepration
separationDelays = []
Expand Down Expand Up @@ -793,7 +793,7 @@ def run_simulation(

if branch_ct == num_stages:
for branch_nr in range(branch_ct):
# was there any exception thrown? -> skip results fo this stage
# was there any exception thrown? -> skip results for this stage
events = sim.getSimulatedData().getBranch(branch_nr).getEvents()
for ev in events:
# how do I get the source of the exception?
Expand Down