diff options
Diffstat (limited to 'subprojects/store-dse/src/main/java/tools/refinery/store/dse/objectives/AlwaysSatisfiedDummyHardObjective.java')
-rw-r--r-- | subprojects/store-dse/src/main/java/tools/refinery/store/dse/objectives/AlwaysSatisfiedDummyHardObjective.java | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/subprojects/store-dse/src/main/java/tools/refinery/store/dse/objectives/AlwaysSatisfiedDummyHardObjective.java b/subprojects/store-dse/src/main/java/tools/refinery/store/dse/objectives/AlwaysSatisfiedDummyHardObjective.java new file mode 100644 index 00000000..82695704 --- /dev/null +++ b/subprojects/store-dse/src/main/java/tools/refinery/store/dse/objectives/AlwaysSatisfiedDummyHardObjective.java | |||
@@ -0,0 +1,51 @@ | |||
1 | /******************************************************************************* | ||
2 | * Copyright (c) 2010-2016, Andras Szabolcs Nagy, Zoltan Ujhelyi and Daniel Varro | ||
3 | * This program and the accompanying materials are made available under the | ||
4 | * terms of the Eclipse Public License v. 2.0 which is available at | ||
5 | * http://www.eclipse.org/legal/epl-v20.html. | ||
6 | * | ||
7 | * SPDX-License-Identifier: EPL-2.0 | ||
8 | *******************************************************************************/ | ||
9 | package tools.refinery.store.dse.objectives; | ||
10 | |||
11 | import tools.refinery.store.dse.DesignSpaceExplorationAdapter; | ||
12 | |||
13 | /** | ||
14 | * This hard objective is fulfilled in any circumstances. Use it if all states should be regarded as a valid solution. | ||
15 | * | ||
16 | * @author Andras Szabolcs Nagy | ||
17 | * | ||
18 | */ | ||
19 | public class AlwaysSatisfiedDummyHardObjective extends BaseObjective { | ||
20 | |||
21 | private static final String DEFAULT_NAME = "AlwaysSatisfiedDummyHardObjective"; | ||
22 | |||
23 | public AlwaysSatisfiedDummyHardObjective() { | ||
24 | super(DEFAULT_NAME); | ||
25 | } | ||
26 | |||
27 | public AlwaysSatisfiedDummyHardObjective(String name) { | ||
28 | super(name); | ||
29 | } | ||
30 | |||
31 | @Override | ||
32 | public Double getFitness(DesignSpaceExplorationAdapter context) { | ||
33 | return 0d; | ||
34 | } | ||
35 | |||
36 | @Override | ||
37 | public boolean isHardObjective() { | ||
38 | return true; | ||
39 | } | ||
40 | |||
41 | @Override | ||
42 | public boolean satisfiesHardObjective(Double fitness) { | ||
43 | return true; | ||
44 | } | ||
45 | |||
46 | @Override | ||
47 | public Objective createNew() { | ||
48 | return this; | ||
49 | } | ||
50 | |||
51 | } | ||