Skip to content

Commit

Permalink
Merge pull request #54 from PalladioSimulator/prism_process
Browse files Browse the repository at this point in the history
Prism process
  • Loading branch information
rsfzi authored Jan 10, 2025
2 parents 571f3d5 + de810f6 commit 39e2202
Show file tree
Hide file tree
Showing 23 changed files with 287 additions and 302 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
import org.palladiosimulator.simexp.pcm.config.IModelledPrismWorkflowConfiguration;
import org.palladiosimulator.simexp.pcm.examples.deltaiot.DeltaIoTPartiallyEnvDynamics;
import org.palladiosimulator.simexp.pcm.examples.deltaiot.DeltaIoTSampleLogger;
import org.palladiosimulator.simexp.pcm.examples.deltaiot.FileDumperPrismObserver;
import org.palladiosimulator.simexp.pcm.examples.deltaiot.param.reconfigurationparams.DeltaIoTReconfigurationParamRepository;
import org.palladiosimulator.simexp.pcm.examples.deltaiot.process.DeltaIoTPcmBasedPrismExperienceSimulationRunner;
import org.palladiosimulator.simexp.pcm.examples.deltaiot.process.EnergyConsumptionPrismFileUpdater;
Expand Down Expand Up @@ -121,8 +120,6 @@ protected PcmExperienceSimulationExecutor<PCMInstance, QVTOReconfigurator, QVToR
IExperimentProvider experimentProvider = createExperimentProvider(experiment);
DeltaIoTPcmBasedPrismExperienceSimulationRunner<QVTOReconfigurator> runner = new DeltaIoTPcmBasedPrismExperienceSimulationRunner<>(
prismGenerator, prismFolder, strategyId, reconfParamsRepo, experimentProvider);
FileDumperPrismObserver observer = new FileDumperPrismObserver(prismFolder);
runner.addPrismObserver(observer);

IQVToReconfigurationManager qvtoReconfigurationManager = createQvtoReconfigurationManager(experiment,
getWorkflowConfiguration());
Expand Down Expand Up @@ -179,9 +176,9 @@ private Path getPrismFolder(String strategyId) {
.getLocation();
Path outputBasePath = Paths.get(workspaceBasePath.toString());
Path resourcePath = outputBasePath.resolve("resource");
Path prismPath = resourcePath.resolve("prism");
Path prismStrategyPath = prismPath.resolve(strategyId);
return prismStrategyPath;
Path prismStrategyPath = resourcePath.resolve(strategyId);
Path prismPath = prismStrategyPath.resolve("prism");
return prismPath;
}

private SimulatedMeasurementSpecification findPrismMeasurementSpec(List<PrismSimulatedMeasurementSpec> specs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ source.. = src/main/resources/
output.. = target/
bin.includes = META-INF/,\
.,\
os/linux/x86_64/*.so
os/linux/x86_64/
Original file line number Diff line number Diff line change
@@ -1 +1 @@
*.so
*
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,19 @@
<version>3.3.1</version>
<executions>
<execution>
<id>copy-linux-shared_libraries</id>
<id>copy-linux-files</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.basedir}/os/linux/x86_64</outputDirectory>
<outputDirectory>${project.basedir}/os/linux/x86_64</outputDirectory>
<resources>
<resource>
<directory>${project.build.directory}/${prism.file}/lib</directory>
<directory>${project.build.directory}/${prism.file}</directory>
<includes>
<include>*.so</include>
<include>bin/</include>
<include>lib/</include>
</includes>
</resource>
</resources>
Expand All @@ -67,6 +68,26 @@
</executions>
</plugin>

<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>maven-replacer-plugin</artifactId>
<version>1.3.7</version>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>replace</goal>
</goals>
</execution>
</executions>
<configuration>
<file>os/linux/x86_64/bin/prism</file>
<regex>false</regex>
<token>PRISM_DIR="/home/ubuntu/prism/prism"</token>
<value>PRISM_DIR=$( dirname $( dirname $(realpath $0) ) )</value>
</configuration>
</plugin>

</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"prefix": "lib",
"extension": ".so",
"libraries": ["dd", "dv", "jdd", "lpsolve55", "lpsolve55j", "odd", "prismhybrid", "prismmtbdd", "prismsparse", "prism"]
}
{
"architecture": "linux.gtk.x86_64",
"folder": "x86_64",
"binaryExtension": ""
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ source.. = src/main/resources/
output.. = target/
bin.includes = META-INF/,\
.,\
os/win32/x86_64/*.dll
os/win32/x86_64/
Original file line number Diff line number Diff line change
@@ -1 +1 @@
*.dll
*
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<version>3.3.1</version>
<executions>
<execution>
<id>copy-windows-shared_libraries</id>
<id>copy-windows-files</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-resources</goal>
Expand All @@ -61,17 +61,38 @@
<outputDirectory>${project.basedir}/os/win32/x86_64</outputDirectory>
<resources>
<resource>
<directory>${env.PRISM}/lib</directory>
<directory>${env.PRISM}</directory>
<includes>
<include>*.dll</include>
<include>bin/</include>
<include>lib/</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>

<!--plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>maven-replacer-plugin</artifactId>
<version>1.3.7</version>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>replace</goal>
</goals>
</execution>
</executions>
<configuration>
<file>os/win32/x86_64/bin/prism.bat</file>
<regex>false</regex>
<token>set PRISM_DIR=..</token>
<value>PRISM_DIR=$( dirname $( dirname $(realpath $0) ) )</value>
</configuration>
</plugin-->

</plugins>
</build>
</profile>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"prefix": "",
"extension": ".dll",
"libraries": ["dd", "dv", "jdd", "lpsolve55", "lpsolve55j", "odd", "prism", "prismsparse", "prismmtbdd", "prismhybrid"]
}
{
"architecture": "win32.win32.x86_64",
"folder": "x86_64",
"binaryExtension": ".bat"
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,5 @@
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="lib" path="lib/colt.jar"/>
<classpathentry kind="lib" path="lib/epsgraphics.jar"/>
<classpathentry kind="lib" path="lib/jas.jar"/>
<classpathentry kind="lib" path="lib/jcommon.jar"/>
<classpathentry kind="lib" path="lib/jfreechart.jar"/>
<classpathentry kind="lib" path="lib/jhoafparser.jar"/>
<classpathentry kind="lib" path="lib/lpsolve55j.jar"/>
<classpathentry kind="lib" path="lib/nailgun-server.jar"/>
<classpathentry kind="lib" path="lib/prism.jar"/>
<classpathentry kind="output" path="target"/>
</classpath>
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,12 @@ Require-Bundle: org.eclipse.core.runtime,
org.palladiosimulator.simexp.pcm.prism;bundle-version="1.0.0",
org.palladiosimulator.simexp.service;bundle-version="1.0.0",
org.apache.log4j;bundle-version="1.2.19",
com.google.gson;bundle-version="2.8.2"
com.google.gson;bundle-version="2.8.2",
org.apache.commons.lang3;bundle-version="3.1.0",
org.apache.commons.io;bundle-version="2.8.0"
Bundle-RequiredExecutionEnvironment: JavaSE-17
Automatic-Module-Name: org.palladiosimulator.simexp.pcm.prism.wrapper
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: lib/colt.jar,
lib/epsgraphics.jar,
lib/jas.jar,
lib/jcommon.jar,
lib/jfreechart.jar,
lib/jhoafparser.jar,
lib/junit-platform-console-standalone.jar,
lib/log4j-api.jar,
lib/log4j-core.jar,
lib/lpsolve55j.jar,
lib/nailgun-server.jar,
lib/prism.jar,
.
Bundle-ClassPath: .
Bundle-Name: Prism wrapper
Export-Package: de.fzi.srp.simulatedexperience.prism.wrapper.service
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@ source.. = src/
output.. = target/
bin.includes = META-INF/,\
plugin.xml,\
lib/,\
.,\
lib/*.jar
.

This file was deleted.

Empty file.
70 changes: 0 additions & 70 deletions bundles/org.palladiosimulator.simexp.pcm.prism.wrapper/pom.xml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package de.fzi.srp.simulatedexperience.prism.wrapper.service;

import java.io.IOException;

@FunctionalInterface
public interface IOFunction<T> {
void accept(T t) throws IOException;
}
Loading

0 comments on commit 39e2202

Please sign in to comment.