src/main/java/net/floodlightcontroller/myrouting/MyRoutingUtils.java
/**
	 * cal the cost of the two switch
	 * @param srcSwitchId
	 * @param destSwitchId
	 * @return
	 */
cal the cost of the two switch
@param srcSwitchId
@param destSwitchId
@return
cal the cost of the two switch @param srcSwitchId @param destSwitchId @return
public static int calSwitchCost(long srcSwitchId,long destSwitchId) {
		boolean isSrcEven=(srcSwitchId%2==0);
		boolean isDestEven=(destSwitchId%2==0);
		int cost=0;
		if(isSrcEven&&isDestEven) {
			cost=100;
		}else if((!isSrcEven) && (!isDestEven)) {
			cost=1;
		}else {
			cost=10;
		}
		MyRoutingLog.debug("cal cost:"+srcSwitchId+","+destSwitchId+","+cost);
		return cost;
	}
public static int calSwitchCost ( long srcSwitchId , long destSwitchId ) { boolean isSrcEven = ( srcSwitchId % 2 == 0 ) ; boolean isDestEven = ( destSwitchId % 2 == 0 ) ; int cost = 0 ; if ( isSrcEven && isDestEven ) { cost = 100 ; } else if ( ( ! isSrcEven ) && ( ! isDestEven ) ) { cost = 1 ; } else { cost = 10 ; } MyRoutingLog . debug ( "cal cost:" + srcSwitchId + "," + destSwitchId + "," + cost ) ; return cost ; }
cal the cost of the two switch
 @param srcSwitchId
 @param destSwitchId
 @return
cal the cost of the two switch @param srcSwitchId @param destSwitchId @return
//both even //both odd