Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright 2015-present Open Networking Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onlab.graph;
import java.security.SecureRandom;
import java.util.Map;
import java.util.List;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Random;
import java.util.Set;
/**
* SRLG Graph Search finds a pair of paths with disjoint risk groups; i.e
* if one path goes through an edge in risk group 1, the other path will go
* through no edges in risk group 1.
*/
public class SrlgGraphSearch>
extends AbstractGraphPathSearch {
static final int ITERATIONS = 100;
static final int POPSIZE = 50;
boolean useSuurballe = false;
static final double INF = 100000000.0;
int numGroups;
Map riskGrouping;
Graph orig;
V src, dst;
EdgeWeigher weigher;
/**
* Creates an SRLG graph search object with the given number
* of groups and given risk mapping.
*
* @param groups the number of disjoint risk groups
* @param grouping map linking edges to integral group assignments
*/
public SrlgGraphSearch(int groups, Map grouping) {
numGroups = groups;
riskGrouping = grouping;
}
/**
* Creates an SRLG graph search object from a map, inferring
* the number of groups and creating an integral mapping.
*
* @param grouping map linking edges to object group assignments,
* with same-group status linked to equality
*/
public SrlgGraphSearch(Map grouping) {
if (grouping == null) {
useSuurballe = true;
return;
}
numGroups = 0;
HashMap