本文整理汇总了Java中com.subgraph.orchid.Router.isPossibleGuard方法的典型用法代码示例。如果您正苦于以下问题:Java Router.isPossibleGuard方法的具体用法?Java Router.isPossibleGuard怎么用?Java Router.isPossibleGuard使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.subgraph.orchid.Router
的用法示例。
在下文中一共展示了Router.isPossibleGuard方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testCurrentlyUsable
import com.subgraph.orchid.Router; //导入方法依赖的package包/类
public boolean testCurrentlyUsable() {
final Router router = getRouterForEntry();
boolean isUsable = router != null && router.isValid() && router.isPossibleGuard() && router.isRunning();
if(isUsable) {
markUsable();
return true;
} else {
markUnusable();
return false;
}
}
示例2: adjustTotals
import com.subgraph.orchid.Router; //导入方法依赖的package包/类
private void adjustTotals(Router router, double bw) {
if(router.isExit()) {
totalExitBw += bw;
} else {
totalNonExitBw += bw;
}
if(router.isPossibleGuard()) {
totalGuardBw += bw;
}
}
示例3: adjustWeights
import com.subgraph.orchid.Router; //导入方法依赖的package包/类
void adjustWeights(double exitWeight, double guardWeight) {
for(WeightedRouter wr: weightedRouters) {
Router r = wr.router;
if(r.isExit() && r.isPossibleGuard()) {
wr.weightedBandwidth *= (exitWeight * guardWeight);
} else if(r.isPossibleGuard()) {
wr.weightedBandwidth *= guardWeight;
} else if(r.isExit()) {
wr.weightedBandwidth *= exitWeight;
}
}
scaleRouterWeights();
}