use of org.btrplace.safeplace.testing.fuzzer.domain.ConstantDomain in project scheduler by btrplace.
the class DefaultFuzzer method domain.
private Domain<?> domain(UserVar<?> v, Model mo) {
Domain<?> d = doms.get(v.label());
if (d != null) {
return d;
}
// Default domains
if (!(v.getBackend().type() instanceof SetType)) {
return null;
}
SetType back = (SetType) v.getBackend().type();
if (back.enclosingType().equals(NodeType.getInstance())) {
return new ConstantDomain<>(rnd, "nodes", NodeType.getInstance(), new ArrayList<>(mo.getMapping().getAllNodes()));
} else if (back.enclosingType().equals(VMType.getInstance())) {
return new ConstantDomain<>(rnd, "vms", VMType.getInstance(), new ArrayList<>(mo.getMapping().getAllVMs()));
}
throw new IllegalArgumentException("No domain value attached to argument '" + v.label() + "'");
}
Aggregations