本文整理汇总了Java中dr.evolution.alignment.SitePatterns.getFrom方法的典型用法代码示例。如果您正苦于以下问题:Java SitePatterns.getFrom方法的具体用法?Java SitePatterns.getFrom怎么用?Java SitePatterns.getFrom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dr.evolution.alignment.SitePatterns
的用法示例。
在下文中一共展示了SitePatterns.getFrom方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doOperation
import dr.evolution.alignment.SitePatterns; //导入方法依赖的package包/类
public double doOperation() {
// Select boundary to update, 0 => btw partition 0 and 1, 1 => btw partition 1 and 2, etc.
int whichBoundary = MathUtils.nextInt(breakPoints.getDimension());
int cBreakPt = (int) breakPoints.getParameterValue(whichBoundary);
SitePatterns left = partitions.get(whichBoundary);
SitePatterns right = partitions.get(whichBoundary + 1);
int min = left.getFrom();
int max = right.getTo();
int pBreakPt = min;
while (pBreakPt <= min || pBreakPt >= max) { // cBreakPt + [windowSize-1, windowSize+1] (and not 0)
if (MathUtils.nextBoolean())
pBreakPt = cBreakPt + MathUtils.nextInt(windowSize) + 1;
else
pBreakPt = cBreakPt - MathUtils.nextInt(windowSize) - 1;
}
return 0;
}
示例2: arePartitionsContiguous
import dr.evolution.alignment.SitePatterns; //导入方法依赖的package包/类
public static boolean arePartitionsContiguous(List<SitePatterns> list) {
int current = -1;
int index = 0;
for (SitePatterns patterns : list) {
int start = patterns.getFrom();
int end = patterns.getTo();
/* System.err.println(start+" -> "+end+" : "+patterns.getSiteCount()+" "+patterns.getPatternCount());
int[] data = patterns.getSitePattern(0);
System.err.print("Data 0:");
for (int i : data)
System.err.print(" "+i);
System.err.println("");*/
// if (current == -1)
// current = end;
if (current != -1 && start != (current + 1))
// throw new NonContiguousPartitionsException("Partition #"+0+" does not start contiguously");
return false;
current = end;
}
return true;
}
示例3: doOperation
import dr.evolution.alignment.SitePatterns; //导入方法依赖的package包/类
public double doOperation() throws OperatorFailedException {
// Select boundary to update, 0 => btw partition 0 and 1, 1 => btw partition 1 and 2, etc.
int whichBoundary = MathUtils.nextInt(breakPoints.getDimension());
int cBreakPt = (int) breakPoints.getParameterValue(whichBoundary);
SitePatterns left = partitions.get(whichBoundary);
SitePatterns right = partitions.get(whichBoundary + 1);
int min = left.getFrom();
int max = right.getTo();
int pBreakPt = min;
while (pBreakPt <= min || pBreakPt >= max) { // cBreakPt + [windowSize-1, windowSize+1] (and not 0)
if (MathUtils.nextBoolean())
pBreakPt = cBreakPt + MathUtils.nextInt(windowSize) + 1;
else
pBreakPt = cBreakPt - MathUtils.nextInt(windowSize) - 1;
}
return 0;
}