Commit 0257b063 authored by Marco Volpe's avatar Marco Volpe
Browse files

Basic contraints for DeploSchedule synthesis moved out of GUI.

Issue-Ref: 3648
Issue-Url: https://af3-developer.fortiss.org/issues/3648

Signed-off-by: Marco Volpe's avatarMarco Volpe <volpe@fortiss.org>
parent 5854faae
Z3Backend.java 5f1cdfdd1d9ed1047d40b5ad82a18c21cea14818 YELLOW
Z3Backend.java e5a70c7191e47aaafaa5031451e70150cfc3d1e0 YELLOW
......@@ -15,6 +15,7 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.exploration.smt.backend;
import static org.fortiss.af3.exploration.smt.modeltransformation.BasicDeploScheduleConstraint.generateBasicScheduleConstraints;
import static org.fortiss.af3.exploration.smt.modeltransformation.BasicDeploymentConstraint.createBasicSignalConstraints;
import static org.fortiss.af3.exploration.util.ExplorationUtils.isDebugVerboseEnabled;
......@@ -27,10 +28,13 @@ import java.util.Set;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.emf.common.util.EList;
import org.fortiss.af3.deployment.model.VirtualLink;
import org.fortiss.af3.exploration.model.ExplorationSpecification;
import org.fortiss.af3.exploration.model.ExplorationTarget;
import org.fortiss.af3.exploration.model.IExplorationFeature;
import org.fortiss.af3.exploration.model.SuperSetMap;
import org.fortiss.af3.exploration.model.solutions.ExplorationSolution;
import org.fortiss.af3.exploration.projectmodel.RuleSet;
import org.fortiss.af3.exploration.service.DSESolutionVisualization;
import org.fortiss.af3.exploration.service.IDSEBackend;
import org.fortiss.af3.exploration.smt.model.SMTConstraint;
......@@ -40,9 +44,11 @@ import org.fortiss.af3.exploration.smt.modeltransformation.ScheduleRun;
import org.fortiss.af3.exploration.smt.modeltransformation.SolverRun;
import org.fortiss.af3.platform.model.ExecutionUnit;
import org.fortiss.af3.platform.model.TransmissionUnit;
import org.fortiss.af3.schedule.model.ResourceAllocation;
import org.fortiss.af3.schedule.model.Schedule;
import org.fortiss.af3.task.model.Signal;
import org.fortiss.af3.task.model.Task;
import org.fortiss.af3.task.model.allocation.ComponentToTaskAllocationEntry;
import org.fortiss.af3.task.model.allocation.TaskToExecutionUnitAllocationTable;
import org.fortiss.tooling.base.model.element.IModelElement;
......@@ -63,37 +69,50 @@ public class Z3Backend implements IDSEBackend {
Set<Class<? extends IModelElement>> solutionTypes,
Collection<IExplorationFeature> explorationModules, IProgressMonitor monitor,
int timeoutMS) throws Exception {
if(spec.getTargets().isEmpty()) {
throw new Exception("No exploration targets defined. Cannot perform DSE.");
}
List<SMTConstraint> basicCons = createBasicSignalConstraints(spec.getSearchSpace());
SuperSetMap superSets = spec.getSearchSpace();
List<SMTConstraint> basicDeploymentConstraints = createBasicSignalConstraints(superSets);
SolverRun solverRun;
if(solutionTypes.contains(Schedule.class) &&
solutionTypes.contains(TaskToExecutionUnitAllocationTable.class)) {
// Add SMT-specific constraints to define the basic deployment problem.
insertBasicConstraints(spec, basicCons);
RuleSet basicScheduleConstraints =
generateBasicScheduleConstraints(superSets.get(ResourceAllocation.class),
superSets.get(Task.class), superSets.get(Signal.class),
superSets.get(ExecutionUnit.class), superSets.get(VirtualLink.class),
superSets.get(ComponentToTaskAllocationEntry.class));
spec.getTargets().addAll(basicScheduleConstraints.getExplorationTargets());
insertBasicConstraints(spec, basicDeploymentConstraints);
if(isDebugVerboseEnabled()) {
System.out.println("DeploScheduleRun");
}
if(spec.getTargets().isEmpty()) {
throw new Exception("No exploration targets defined. Cannot perform DSE.");
}
solverRun = new DeploScheduleRun();
} else if(solutionTypes.contains(TaskToExecutionUnitAllocationTable.class)) {
// Add SMT-specific constraints to define the basic deployment problem.
insertBasicConstraints(spec, basicCons);
insertBasicConstraints(spec, basicDeploymentConstraints);
if(isDebugVerboseEnabled()) {
System.out.println("DeploymentRun");
}
if(spec.getTargets().isEmpty()) {
throw new Exception("No exploration targets defined. Cannot perform DSE.");
}
solverRun = new DeploymentRun();
} else {
if(isDebugVerboseEnabled()) {
System.out.println("ScheduleRun");
}
if(spec.getTargets().isEmpty()) {
throw new Exception("No exploration targets defined. Cannot perform DSE.");
}
solverRun = new ScheduleRun();
}
ExplorationSolution expSolution = solverRun.solve(spec, timeoutMS, monitor);
// remove basic constraints
spec.getTargets().removeAll(basicCons);
spec.getTargets().removeAll(basicDeploymentConstraints);
return Optional.of(expSolution);
}
......
BasicDeploScheduleConstraint.java c45ed3b3dcfd46140f17594da7bb41edf433796f GREEN
BasicDeploScheduleConstraint.java a4bf57226f3f987dd02cef5592b77d81a3b03be9 YELLOW
BasicDeploymentConstraint.java ee43f8ad92f3c93d8ba1a742f4a9830c75ad0ce1 GREEN
BasicScheduleConstraint.java 7d08ab1735f7d2b1ef8afe6799739156bef07cb1 GREEN
ConstraintDefinitionUtils.java f110a4a216905d2236324ae459d789d50114e25c GREEN
ConstraintDefinitionUtils.java 48761ac3daa8d77008e6c334b3405aef4178ddb5 YELLOW
ConstraintToNonQuantifiedSMT.java de0e8a7000e26d745b62a27f8c2482e7a7737add GREEN
ConstraintToQuantifiedSMT.java c84e799c69195fe80a2e66a39d0192325b06c7fd GREEN
DSMLTransformationService.java b2e90e11e36346d01c79c18f16ffc62f66f35888 GREEN
......
......@@ -30,6 +30,8 @@ import static org.fortiss.af3.exploration.smt.modeltransformation.ConstraintDefi
import static org.fortiss.af3.exploration.smt.modeltransformation.ConstraintDefinitionUtils.getSignal;
import static org.fortiss.af3.exploration.smt.modeltransformation.ConstraintDefinitionUtils.intersects;
import static org.fortiss.af3.exploration.smt.modeltransformation.ConstraintDefinitionUtils.isStronglyCausal;
import static org.fortiss.af3.exploration.smt.util.Z3ModelElementFactory.createSMTConstraint;
import static org.fortiss.af3.exploration.util.DSEProjectModelElementFactory.createRuleSet;
import static org.fortiss.af3.exploration.util.DSMLModelElementFactory.createAllocation;
import static org.fortiss.af3.exploration.util.DSMLModelElementFactory.createAnd;
import static org.fortiss.af3.exploration.util.DSMLModelElementFactory.createArithmeticLiteral;
......@@ -49,9 +51,12 @@ import static org.fortiss.af3.exploration.util.DSMLModelElementFactory.createOr;
import static org.fortiss.af3.exploration.util.DSMLModelElementFactory.createPlus;
import static org.fortiss.af3.exploration.util.DSMLModelElementFactory.createSet;
import static org.fortiss.af3.exploration.util.DSMLModelElementFactory.createSum;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getFirstParentWithType;
import static org.fortiss.tooling.kernel.utils.UniqueIDUtils.prepareUniqueID;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.fortiss.af3.deployment.model.VirtualLink;
......@@ -84,8 +89,11 @@ import org.fortiss.af3.exploration.dsl_v2.model.function.ScheduledSignal;
import org.fortiss.af3.exploration.dsl_v2.model.function.ScheduledTask;
import org.fortiss.af3.exploration.dsl_v2.model.function.Start;
import org.fortiss.af3.exploration.dsl_v2.model.function.StronglyCausal;
import org.fortiss.af3.exploration.projectmodel.RuleSet;
import org.fortiss.af3.exploration.smt.model.DurationDummy;
import org.fortiss.af3.exploration.smt.model.SMTConstraint;
import org.fortiss.af3.platform.model.ExecutionUnit;
import org.fortiss.af3.project.model.FileProject;
import org.fortiss.af3.schedule.model.ResourceAllocation;
import org.fortiss.af3.schedule.model.SchedulableEntity;
import org.fortiss.af3.schedule.model.SystemSchedule;
......@@ -93,7 +101,7 @@ import org.fortiss.af3.task.model.Message;
import org.fortiss.af3.task.model.Signal;
import org.fortiss.af3.task.model.Task;
import org.fortiss.af3.task.model.TaskOutputPort;
import org.fortiss.af3.task.model.allocation.ComponentToTaskAllocationTable;
import org.fortiss.af3.task.model.allocation.ComponentToTaskAllocationEntry;
import org.fortiss.tooling.base.model.element.IModelElement;
/**
......@@ -103,6 +111,49 @@ import org.fortiss.tooling.base.model.element.IModelElement;
*/
public class BasicDeploScheduleConstraint {
/** Generates standard schedule constraints for a deployment+scheduling run. */
public static RuleSet generateBasicScheduleConstraints(SuperSet<ResourceAllocation> resAllocSS,
SuperSet<Task> taskSS, SuperSet<Signal> signalSS, SuperSet<ExecutionUnit> ecuSS,
SuperSet<VirtualLink> vrtLinkSS, SuperSet<ComponentToTaskAllocationEntry> co2ta) {
RuleSet s = createRuleSet();
s.setImplicit(true);
s.setName("Implicit Basic Schedule Constraints");
s.setDate(new Date());
s.setAuthor("None");
s.setComment("Automatically added constraint.");
FileProject fileProject = getFirstParentWithType(co2ta, FileProject.class);
// creates constraints without unfolding of quantifiers
List<IBooleanExpression> assertions = new ArrayList<>();
assertions.addAll(createECUNonOverlappingConstraints(resAllocSS, taskSS, ecuSS));
assertions.addAll(createVLNonOverlappingConstraints(resAllocSS, signalSS, vrtLinkSS));
assertions.addAll(createCausalityConstraints(resAllocSS, taskSS, signalSS, ecuSS));
int i = 0;
for(IBooleanExpression a : assertions) {
SMTConstraint ts =
createSMTConstraint("Implicit Schedule Constraint " + i++, a, true, false);
s.getExplorationTargets().add(ts);
prepareUniqueID(ts, fileProject);
}
// creates constraints with unfolding of quantifiers
assertions = new ArrayList<>();
assertions.addAll(createStronglyCausalFunction(taskSS, co2ta));
assertions.addAll(createIsTaskFunction(resAllocSS));
assertions.addAll(createIntersectsFunction(vrtLinkSS));
assertions.addAll(createResAllocMapping(resAllocSS, taskSS, signalSS));
assertions.addAll(createDurationConstraints(resAllocSS, signalSS, ecuSS, vrtLinkSS));
assertions.addAll(createGreaterEqualZeroConstraints(resAllocSS));
for(IBooleanExpression a : assertions) {
SMTConstraint ts = createSMTConstraint("Implicit Schedule Constraint " + i++, a, true);
s.getExplorationTargets().add(ts);
prepareUniqueID(ts, fileProject);
}
return s;
}
/**
* Creates an objective that minimizes the sum of starting times of tasks, for the given
* {@link SystemSchedule}.
......@@ -247,7 +298,7 @@ public class BasicDeploScheduleConstraint {
// TODO (#3554)
/** Creates a constraint that defines the function {@link StronglyCausal}. */
public static List<? extends IBooleanExpression> createStronglyCausalFunction(
SuperSet<Task> taskSS, ComponentToTaskAllocationTable co2ta) {
SuperSet<Task> taskSS, SuperSet<ComponentToTaskAllocationEntry> co2ta) {
List<IBooleanExpression> assertions = new ArrayList<>();
......
......@@ -65,7 +65,7 @@ import org.fortiss.af3.task.model.Signal;
import org.fortiss.af3.task.model.Task;
import org.fortiss.af3.task.model.TaskInputPort;
import org.fortiss.af3.task.model.TaskOutputPort;
import org.fortiss.af3.task.model.allocation.ComponentToTaskAllocationTable;
import org.fortiss.af3.task.model.allocation.ComponentToTaskAllocationEntry;
import org.fortiss.af3.task.model.timing.SignalReceiveEvent;
import org.fortiss.af3.task.model.timing.SignalSendEvent;
import org.fortiss.af3.task.model.timing.TaskStartEvent;
......@@ -74,6 +74,8 @@ import org.fortiss.af3.timing.model.Event;
import org.fortiss.af3.timing.model.annotation.Wcet;
import org.fortiss.tooling.base.model.element.IConnection;
import org.fortiss.tooling.base.model.element.IModelElement;
import org.fortiss.af3.task.model.allocation.ComponentToTaskAllocationTable;
/**
* Class that contains utilities for the definition of DSML constraints.
......@@ -230,6 +232,27 @@ public class ConstraintDefinitionUtils {
return forAll;
}
/**
* Returns true if the given {@link Task} is strongly causal, i.e. if at least one of the
* logical {@link Component}s allocated to it is strongly causal.
*/
public static boolean isStronglyCausal(Task task,
SuperSet<ComponentToTaskAllocationEntry> ca2ta) {
if(ca2ta == null) {
return false;
}
for(ComponentToTaskAllocationEntry entry : ca2ta.getEntries()) {
if(entry.getTask() == task) {
for(IModelElement comp : entry.getSourceElements()) {
if(((Component)comp).isStronglyCausal()) {
return true;
}
}
}
}
return false;
}
/**
* Returns true if the given {@link Task} is strongly causal, i.e. if at least one of the
* logical {@link Component}s allocated to it is strongly causal.
......
DeploymentSynthesisViewBackend.java c53076fdca46d293ff2e7cc6ea107f6470357d17 RED
DeploymentSynthesisViewBackend.java 26083b500eb95d44ea3e60d1393217a22d19050c YELLOW
ExplorationSynthesisView.java 3862b2d46f4a40cdccf991a8a9994212497639c2 RED
PlatformSynthesisViewBackend.java 9bf3ee745f7579e6ada48e164fd13464ae80d55a RED
ScheduleSynthesisViewBackend.java 5e4c68a46aacb2bd11e1b4ffdd6f7b5a130a6822 RED
......@@ -19,19 +19,9 @@ import static java.util.Arrays.asList;
import static org.eclipse.emf.ecore.util.EcoreUtil.copyAll;
import static org.eclipse.jface.dialogs.MessageDialog.openError;
import static org.eclipse.jface.dialogs.MessageDialog.openInformation;
import static org.fortiss.af3.exploration.smt.modeltransformation.BasicDeploScheduleConstraint.createCausalityConstraints;
import static org.fortiss.af3.exploration.smt.modeltransformation.BasicDeploScheduleConstraint.createDurationConstraints;
import static org.fortiss.af3.exploration.smt.modeltransformation.BasicDeploScheduleConstraint.createECUNonOverlappingConstraints;
import static org.fortiss.af3.exploration.smt.modeltransformation.BasicDeploScheduleConstraint.createGreaterEqualZeroConstraints;
import static org.fortiss.af3.exploration.smt.modeltransformation.BasicDeploScheduleConstraint.createIntersectsFunction;
import static org.fortiss.af3.exploration.smt.modeltransformation.BasicDeploScheduleConstraint.createIsTaskFunction;
import static org.fortiss.af3.exploration.smt.modeltransformation.BasicDeploScheduleConstraint.createMinimizeSumObjective;
import static org.fortiss.af3.exploration.smt.modeltransformation.BasicDeploScheduleConstraint.createResAllocMapping;
import static org.fortiss.af3.exploration.smt.modeltransformation.BasicDeploScheduleConstraint.createStronglyCausalFunction;
import static org.fortiss.af3.exploration.smt.modeltransformation.BasicDeploScheduleConstraint.createVLNonOverlappingConstraints;
import static org.fortiss.af3.exploration.smt.modeltransformation.ConstraintDefinitionUtils.createResourceAllocations;
import static org.fortiss.af3.exploration.smt.modeltransformation.TimingConstraintDefinition.generateTimingConstraints;
import static org.fortiss.af3.exploration.smt.util.Z3ModelElementFactory.createSMTConstraint;
import static org.fortiss.af3.exploration.smt.util.Z3ModelElementFactory.createSMTObjective;
import static org.fortiss.af3.exploration.ui.util.ExplorationSolutionVisualizationUtils.createVisualizationFor;
import static org.fortiss.af3.exploration.util.DSEProjectModelElementFactory.createRuleSet;
......@@ -40,7 +30,6 @@ import static org.fortiss.af3.exploration.util.ExplorationUtils.convertRuleSetsT
import static org.fortiss.af3.exploration.util.ExplorationUtils.convertToMap;
import static org.fortiss.af3.schedule.ui.utils.ScheduleUIUtils.showScheduleView;
import static org.fortiss.af3.task.util.TaskModelElementFactory.createTasksToExecutionUnitAllocationTable;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getFirstParentWithType;
import static org.fortiss.tooling.kernel.utils.KernelModelElementUtils.runAsCommand;
import static org.fortiss.tooling.kernel.utils.LoggingUtils.error;
import static org.fortiss.tooling.kernel.utils.UniqueIDUtils.fixMissingIDs;
......@@ -72,9 +61,7 @@ import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.fortiss.af3.deployment.model.VirtualLink;
import org.fortiss.af3.deployment.ui.editor.INamedColumnLabelProvider;
import org.fortiss.af3.exploration.dsl_v2.model.booleanp.IBooleanExpression;
import org.fortiss.af3.exploration.dsl_v2.model.expression.SuperSet;
import org.fortiss.af3.exploration.dsl_v2.model.function.IFunction;
import org.fortiss.af3.exploration.model.ExplorationConstraint;
......@@ -92,19 +79,16 @@ import org.fortiss.af3.exploration.projectmodel.dseArtifacts.DSEPlatformArtifact
import org.fortiss.af3.exploration.projectmodel.dseArtifacts.DSESuperSets;
import org.fortiss.af3.exploration.service.DSESolutionVisualization;
import org.fortiss.af3.exploration.service.IDSEBackendService;
import org.fortiss.af3.exploration.smt.model.SMTConstraint;
import org.fortiss.af3.exploration.smt.model.SMTObjective;
import org.fortiss.af3.exploration.ui.AF3ExplorationUIActivator;
import org.fortiss.af3.exploration.ui.perspective.process.IProcessManager.EProcessStep;
import org.fortiss.af3.exploration.ui.perspective.service.IDSEPerspectiveManager;
import org.fortiss.af3.exploration.ui.perspective.visualization.visualizations.table.ScheduleExporter;
import org.fortiss.af3.exploration.ui.util.HierarchicElementContentProvider;
import org.fortiss.af3.platform.model.ExecutionUnit;
import org.fortiss.af3.project.model.FileProject;
import org.fortiss.af3.schedule.model.ResourceAllocation;
import org.fortiss.af3.schedule.model.Schedule;
import org.fortiss.af3.schedule.model.SystemSchedule;
import org.fortiss.af3.task.model.Signal;
import org.fortiss.af3.task.model.Task;
import org.fortiss.af3.task.model.TaskArchitecture;
import org.fortiss.af3.task.model.allocation.ComponentToTaskAllocationTable;
......@@ -256,7 +240,10 @@ public class DeploymentSynthesisViewBackend extends DeploymentSynthesisViewGUI {
getConstraintsTable().setInput(IDSEPerspectiveManager.INSTANCE.getRuleSets());
}
/** Initializes a {@link DeploScheduleDSERun} and generates the related timing constraints. */
/**
* Initializes a {@link DeploScheduleDSERun} and generates possible optimal timing constraints
* and objectives.
*/
private List<RuleSet> initializeDeploSchedule(SuperSetMap superSets) {
deploSchedule = true;
solModels.add(Schedule.class);
......@@ -282,16 +269,34 @@ public class DeploymentSynthesisViewBackend extends DeploymentSynthesisViewGUI {
dseRun.getRuleSets().addAll(pm.getRuleSets());
dse.getDseRunArtifacts().add(dseRun);
});
Boolean optimized = latencyCheckBox.getSelection();
List<RuleSet> list = new ArrayList<RuleSet>();
// create basic timing constraints
RuleSet basicConstraints = generateBasicScheduleConstraints(
superSets.get(ResourceAllocation.class), superSets.get(Task.class),
superSets.get(Signal.class), superSets.get(ExecutionUnit.class),
superSets.get(VirtualLink.class), co2ta, optimized);
RuleSet rs = createRuleSet();
rs.setImplicit(true);
rs.setName("Latency Minimization Objective");
rs.setDate(new Date());
rs.setAuthor("None");
getConstraintsTable().refresh();
list.add(basicConstraints);
// add latency minimization objective in case the checkbox is selected
if(latencyCheckBox.getSelection()) {
// several options proposed: some are commented out for the moment
List<IFunction> objectives = new ArrayList<>();
// objectives.addAll(createMinimizeMaxTime(resAllocSS, assertions));
runAsCommand(fileProject, () -> {
// objectives.addAll(createMinimizeOverallTimeObjective(resAllocSS));
// objectives.addAll(createMinimizeOverallTimeMultiObjective(resAllocSS));
objectives.addAll(
createMinimizeSumObjective(superSets.get(ResourceAllocation.class)));
});
int i = 0;
for(IFunction o : objectives) {
SMTObjective oSmt = createSMTObjective("Schedule Objective " + i++, o);
rs.getExplorationTargets().add(oSmt);
prepareUniqueID(oSmt, fileProject);
}
list.add(rs);
// list.add(generateLatencyOptimization(superSets.get(ResourceAllocation.class)));
}
// create additional timing constraints
TimingSpecification ts = pm.getTimingSpecificationInScope();
......@@ -450,64 +455,4 @@ public class DeploymentSynthesisViewBackend extends DeploymentSynthesisViewGUI {
}
}
/** Generates standard schedule constraints for a deployment+scheduling run. */
public static RuleSet generateBasicScheduleConstraints(SuperSet<ResourceAllocation> resAllocSS,
SuperSet<Task> taskSS, SuperSet<Signal> signalSS, SuperSet<ExecutionUnit> ecuSS,
SuperSet<VirtualLink> vrtLinkSS, ComponentToTaskAllocationTable co2ta,
boolean optimized) {
RuleSet s = createRuleSet();
s.setImplicit(true);
s.setName("Implicit Basic Schedule Constraints");
s.setDate(new Date());
s.setAuthor("None");
s.setComment("Automatically added constraint.");
FileProject fileProject = getFirstParentWithType(co2ta, FileProject.class);
// creates constraints without unfolding of quantifiers
List<IBooleanExpression> assertions = new ArrayList<>();
assertions.addAll(createECUNonOverlappingConstraints(resAllocSS, taskSS, ecuSS));
assertions.addAll(createVLNonOverlappingConstraints(resAllocSS, signalSS, vrtLinkSS));
assertions.addAll(createCausalityConstraints(resAllocSS, taskSS, signalSS, ecuSS));
int i = 0;
for(IBooleanExpression a : assertions) {
SMTConstraint ts =
createSMTConstraint("Implicit Schedule Constraint " + i++, a, true, false);
s.getExplorationTargets().add(ts);
prepareUniqueID(ts, fileProject);
}
// creates constraints with unfolding of quantifiers
assertions = new ArrayList<>();
assertions.addAll(createStronglyCausalFunction(taskSS, co2ta));
assertions.addAll(createIsTaskFunction(resAllocSS));
assertions.addAll(createIntersectsFunction(vrtLinkSS));
assertions.addAll(createResAllocMapping(resAllocSS, taskSS, signalSS));
assertions.addAll(createDurationConstraints(resAllocSS, signalSS, ecuSS, vrtLinkSS));
assertions.addAll(createGreaterEqualZeroConstraints(resAllocSS));
for(IBooleanExpression a : assertions) {
SMTConstraint ts = createSMTConstraint("Implicit Schedule Constraint " + i++, a, true);
s.getExplorationTargets().add(ts);
prepareUniqueID(ts, fileProject);
}
// add objective for minimization of latency if the corresponding checkBox is selected
// several options proposed: some are commented out for the moment
if(optimized) {
List<IFunction> objectives = new ArrayList<>();
// objectives.addAll(createMinimizeMaxTime(resAllocSS, assertions));
runAsCommand(fileProject, () -> {
// objectives.addAll(createMinimizeOverallTimeObjective(resAllocSS));
// objectives.addAll(createMinimizeOverallTimeMultiObjective(resAllocSS));
objectives.addAll(createMinimizeSumObjective(resAllocSS));
});
i = 0;
for(IFunction o : objectives) {
SMTObjective oSmt = createSMTObjective("Schedule Objective " + i++, o);
s.getExplorationTargets().add(oSmt);
prepareUniqueID(oSmt, fileProject);
}
}
return s;
}
}
Markdown is supported
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