当前位置: 首页>>代码示例>>Java>>正文


Java SitePatterns.getFrom方法代码示例

本文整理汇总了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;
    }
 
开发者ID:beast-dev,项目名称:beast-mcmc,代码行数:23,代码来源:SlidingPatternsOperator.java

示例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;
    }
 
开发者ID:beast-dev,项目名称:beast-mcmc,代码行数:23,代码来源:SlidingPatternsOperator.java

示例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;
    }
 
开发者ID:whdc,项目名称:ieo-beast,代码行数:23,代码来源:SlidingPatternsOperator.java


注:本文中的dr.evolution.alignment.SitePatterns.getFrom方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。