-
Notifications
You must be signed in to change notification settings - Fork 4
/
State.java
31 lines (25 loc) · 823 Bytes
/
State.java
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
package mdd;
/**
* State representation in order to merge equivalent nodes in the MDD recursion.
* Should be adapted to each problem.
* Equivalent states should have the same hashCode and return {@code true} when compared
* with {@code equals} in order to induce collision in the {@code HashMap}.
*/
public interface State {
int hashCode();
boolean equals(Object obj);
/**
* Function assigning a rank to each node of a layer used to determine which nodes to
* delete/merge in restricted/relaxed decision diagrams.
*
* @param node the node containing this state
* @return the rank
*/
double rank(Node node);
/**
* Should return a deep copy of the state.
*
* @return another {@code State} object with the same properties
*/
State copy();
}