Search in sources :

Example 1 with BDDNetwork

use of org.batfish.symbolic.bdd.BDDNetwork in project batfish by batfish.

the class NetworkSlice method allSlices.

public static ArrayList<Supplier<NetworkSlice>> allSlices(DestinationClasses dcs, int fails) {
    BDDNetwork network = BDDNetwork.create(dcs.getGraph());
    ArrayList<Supplier<NetworkSlice>> classes = new ArrayList<>();
    for (Entry<Set<String>, Tuple<HeaderSpace, Tuple<List<Prefix>, Boolean>>> entry : dcs.getHeaderspaceMap().entrySet()) {
        Set<String> devices = entry.getKey();
        HeaderSpace headerspace = entry.getValue().getFirst();
        List<Prefix> prefixes = entry.getValue().getSecond().getFirst();
        Boolean isDefaultCase = entry.getValue().getSecond().getSecond();
        Supplier<NetworkSlice> sup = () -> AbstractionBuilder.createGraph(dcs, network, devices, headerspace, prefixes, fails, isDefaultCase);
        classes.add(sup);
    }
    return classes;
}
Also used : Set(java.util.Set) ArrayList(java.util.ArrayList) BDDNetwork(org.batfish.symbolic.bdd.BDDNetwork) HeaderSpace(org.batfish.datamodel.HeaderSpace) Prefix(org.batfish.datamodel.Prefix) Supplier(java.util.function.Supplier) List(java.util.List) ArrayList(java.util.ArrayList) Tuple(org.batfish.symbolic.utils.Tuple)

Aggregations

ArrayList (java.util.ArrayList)1 List (java.util.List)1 Set (java.util.Set)1 Supplier (java.util.function.Supplier)1 HeaderSpace (org.batfish.datamodel.HeaderSpace)1 Prefix (org.batfish.datamodel.Prefix)1 BDDNetwork (org.batfish.symbolic.bdd.BDDNetwork)1 Tuple (org.batfish.symbolic.utils.Tuple)1