blob: faeedba54789486b229ff6e2dd749e990eae5264 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/*
* SPDX-FileCopyrightText: 2023 The Refinery Authors <https://refinery.tools/>
*
* SPDX-License-Identifier: EPL-2.0
*/
package tools.refinery.store.dse.transition.statespace.internal;
import org.eclipse.collections.impl.set.mutable.primitive.IntHashSet;
import tools.refinery.store.dse.transition.VersionWithObjectiveValue;
import tools.refinery.store.dse.transition.statespace.EquivalenceClassStore;
import tools.refinery.store.statecoding.StateCoderResult;
import tools.refinery.store.statecoding.StateCoderStoreAdapter;
public abstract class FastEquivalenceClassStore extends AbstractEquivalenceClassStore implements EquivalenceClassStore {
final IntHashSet codes;
protected FastEquivalenceClassStore(StateCoderStoreAdapter stateCoderStoreAdapter) {
super(stateCoderStoreAdapter);
this.codes = new IntHashSet();
}
@Override
protected synchronized boolean tryToAdd(StateCoderResult stateCoderResult, VersionWithObjectiveValue newVersion,
int[] emptyActivations, boolean accept) {
return this.codes.add(stateCoderResult.modelCode());
}
@Override
public void resolveOneSymmetry() {
throw new IllegalArgumentException("This equivalence storage is not prepared to resolve symmetries!");
}
}
|