From 912bc8b903dfa6d438c2469ecdad35c181c71830 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Mon, 25 Jan 2021 21:29:12 +0100 Subject: Improving usability, massive refactoring. * Moving all Drools code into their own modules. This fixes ri-engine to acme dependency. * Now they all inherit from their own parent, should be used by third party code too. * Separating acme planning code into its own module. * Splitting rules code from ri-engine into ri-base. ri-engine is now a pure launcher for modules. * Dumping kogito for the most part, but it seems like the planner still requires that. --- .../acme/planning/machine/CloudBalance.java | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 module/acme-planner/src/main/java/io/trygvis/acme/planning/machine/CloudBalance.java (limited to 'module/acme-planner/src/main/java/io/trygvis/acme/planning/machine/CloudBalance.java') diff --git a/module/acme-planner/src/main/java/io/trygvis/acme/planning/machine/CloudBalance.java b/module/acme-planner/src/main/java/io/trygvis/acme/planning/machine/CloudBalance.java new file mode 100644 index 0000000..7311918 --- /dev/null +++ b/module/acme-planner/src/main/java/io/trygvis/acme/planning/machine/CloudBalance.java @@ -0,0 +1,48 @@ +package io.trygvis.acme.planning.machine; + +import org.optaplanner.core.api.domain.solution.PlanningEntityCollectionProperty; +import org.optaplanner.core.api.domain.solution.PlanningScore; +import org.optaplanner.core.api.domain.solution.PlanningSolution; +import org.optaplanner.core.api.domain.solution.ProblemFactCollectionProperty; +import org.optaplanner.core.api.domain.valuerange.ValueRangeProvider; +import org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore; + +import java.util.List; + +@PlanningSolution +public class CloudBalance { + + private List computerList; + + private List processList; + + private HardSoftScore score; + + public CloudBalance(List computerList, List processList) { + this.computerList = computerList; + this.processList = processList; + } + + public CloudBalance() { + } + + @ValueRangeProvider(id = "computerRange") + @ProblemFactCollectionProperty + public List getComputerList() { + return computerList; + } + + @PlanningEntityCollectionProperty + public List getProcessList() { + return processList; + } + + @PlanningScore + public HardSoftScore getScore() { + return score; + } + + public void setScore(HardSoftScore score) { + this.score = score; + } +} -- cgit v1.2.3