
org.shapleyvalue.util.permutation.NodeValue Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of shapley-value-coreV7 Show documentation
Show all versions of shapley-value-coreV7 Show documentation
Shapley value calculation in java
The newest version!
package org.shapleyvalue.util.permutation;
import java.util.ArrayList;
import java.util.List;
public class NodeValue {
@Override
public String toString() {
return "NodeValue [value=" + value + ", nextValues=" + nextValues + "]";
}
private Integer value;
private List nextValues;
public NodeValue(List nextValues) {
this.nextValues = new ArrayList<>();
this.nextValues.addAll(nextValues);
this.value = nextValues.get(0);
this.nextValues.remove(value);
}
public Integer getValue() {
return value;
}
public List getNextValues() {
return new ArrayList<>(nextValues);
}
public void updateValue() {
if(!nextValues.isEmpty())
value = nextValues.get(0);
nextValues.remove(value);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy