diff --git a/Dockerfile b/Dockerfile index 7e3068c..6be4882 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 && \ @@ -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 \ No newline at end of file diff --git a/src/ortools/dispersion_analysis.py b/src/ortools/dispersion_analysis.py index 26c7acb..53ca6eb 100644 --- a/src/ortools/dispersion_analysis.py +++ b/src/ortools/dispersion_analysis.py @@ -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") @@ -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()] @@ -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 = [] @@ -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")): @@ -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( @@ -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 = [] @@ -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?