-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
557 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import ai.timefold.solver.core.api.domain.solution.PlanningEntityCollectionProperty; | ||
import ai.timefold.solver.core.api.domain.solution.PlanningScore; | ||
import ai.timefold.solver.core.api.domain.solution.PlanningSolution; | ||
import ai.timefold.solver.core.api.domain.solution.ProblemFactCollectionProperty; | ||
import ai.timefold.solver.core.api.domain.valuerange.ValueRangeProvider; | ||
import ai.timefold.solver.core.api.score.buildin.simple.SimpleScore; | ||
import ai.timefold.solver.core.impl.domain.solution.descriptor.SolutionDescriptor; | ||
import ai.timefold.solver.core.impl.testdata.domain.TestdataEntity; | ||
import ai.timefold.solver.core.impl.testdata.domain.TestdataObject; | ||
import ai.timefold.solver.core.impl.testdata.domain.TestdataValue; | ||
|
||
@PlanningSolution | ||
public class TestdataInUnnamedPackageSolution extends TestdataObject { | ||
|
||
public static SolutionDescriptor<TestdataInUnnamedPackageSolution> buildSolutionDescriptor() { | ||
return SolutionDescriptor.buildSolutionDescriptor(TestdataInUnnamedPackageSolution.class, TestdataEntity.class); | ||
} | ||
|
||
public static TestdataInUnnamedPackageSolution generateSolution() { | ||
return generateSolution(5, 7); | ||
} | ||
|
||
public static TestdataInUnnamedPackageSolution generateSolution(int valueListSize, int entityListSize) { | ||
TestdataInUnnamedPackageSolution solution = new TestdataInUnnamedPackageSolution("Generated Solution 0"); | ||
List<TestdataValue> valueList = new ArrayList<>(valueListSize); | ||
for (int i = 0; i < valueListSize; i++) { | ||
TestdataValue value = new TestdataValue("Generated Value " + i); | ||
valueList.add(value); | ||
} | ||
solution.setValueList(valueList); | ||
List<TestdataEntity> entityList = new ArrayList<>(entityListSize); | ||
for (int i = 0; i < entityListSize; i++) { | ||
TestdataValue value = valueList.get(i % valueListSize); | ||
TestdataEntity entity = new TestdataEntity("Generated Entity " + i, value); | ||
entityList.add(entity); | ||
} | ||
solution.setEntityList(entityList); | ||
return solution; | ||
} | ||
|
||
private List<TestdataValue> valueList; | ||
private List<TestdataEntity> entityList; | ||
|
||
private SimpleScore score; | ||
|
||
public TestdataInUnnamedPackageSolution() { | ||
} | ||
|
||
public TestdataInUnnamedPackageSolution(String code) { | ||
super(code); | ||
} | ||
|
||
@ValueRangeProvider(id = "valueRange") | ||
@ProblemFactCollectionProperty | ||
public List<TestdataValue> getValueList() { | ||
return valueList; | ||
} | ||
|
||
public void setValueList(List<TestdataValue> valueList) { | ||
this.valueList = valueList; | ||
} | ||
|
||
@PlanningEntityCollectionProperty | ||
public List<TestdataEntity> getEntityList() { | ||
return entityList; | ||
} | ||
|
||
public void setEntityList(List<TestdataEntity> entityList) { | ||
this.entityList = entityList; | ||
} | ||
|
||
@PlanningScore | ||
public SimpleScore getScore() { | ||
return score; | ||
} | ||
|
||
public void setScore(SimpleScore score) { | ||
this.score = score; | ||
} | ||
|
||
// ************************************************************************ | ||
// Complex methods | ||
// ************************************************************************ | ||
|
||
} |
Oops, something went wrong.