Commit 8541b737 authored by Christian Reuschling's avatar Christian Reuschling
Browse files

Making starter scripts finally runnable | adding example fitness

function script
parent 44d6384b
Pipeline #14531 passed with stages
in 1 minute and 2 seconds
#!/bin/bash
bin/genIe.sh
......@@ -98,4 +98,4 @@ firstGenerationParentMetadata=
initialMetadataAtt_2=initVal_2
}
fitnessFunctionExecPath=/home/reuschling/projectz/genIe/src/test/sum23TestFitnessFunction.sh
fitnessFunctionExecPath=sum23TestFitnessFunction.sh
......@@ -150,7 +150,7 @@
<programs>
<program>
<mainClass>de.dfki.sds.genie.genIe</mainClass>
<mainClass>de.dfki.sds.genie.GenIe</mainClass>
<name>genIe</name>
</program>
......
......@@ -27,6 +27,15 @@
</includes>
<fileMode>700</fileMode>
</fileSet>
<fileSet>
<directory>.</directory>
<outputDirectory>.</outputDirectory>
<includes>
<include>*.sh</include>
</includes>
</fileSet>
</fileSets>
<files>
......@@ -34,6 +43,12 @@
<source>license-gplv2.txt</source>
<outputDirectory>/</outputDirectory>
</file>
<file>
<source>geneticOptimization.conf</source>
<outputDirectory>/</outputDirectory>
</file>
</files>
</assembly>
......@@ -21,6 +21,7 @@ import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.nio.file.Path;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
......@@ -119,12 +120,18 @@ public class GenIe extends GeneticParamOptimizer
try
{
LinkedList<String> lCommand = new LinkedList<>();
lCommand.add(m_geneticRunConfig.m_geneticConfig.getUniqueAsString("fitnessFunctionExecPath"));
String strCommandPath = m_geneticRunConfig.m_geneticConfig.getUniqueAsString("fitnessFunctionExecPath");
strCommandPath = Path.of(strCommandPath).toAbsolutePath().toString();
lCommand.add(strCommandPath);
lCommand.addAll(candidate.getCandidateVector());
String strJson = JsonWriter.objectToJson(candidate.getParentMetadata(), CollectionUtilz.createHashMap(JsonWriter.TYPE, false, JsonWriter.PRETTY_PRINT, true));
lCommand.add(strJson);
ProcessBuilder builder = new ProcessBuilder(lCommand);
Process process = builder.start();
......
......@@ -98,4 +98,4 @@ firstGenerationParentMetadata=
initialMetadataAtt_2=initVal_2
}
fitnessFunctionExecPath=/home/reuschling/projectz/genIe/src/test/sum23TestFitnessFunction.sh
fitnessFunctionExecPath=sum23TestFitnessFunction.sh
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment