Examples of Average


Examples of cascading.pattern.ensemble.selection.Average

    switch( modelMethod )
      {
      case MAJORITY_VOTE:
        return new MajorityVote();
      case AVERAGE:
        return new Average();
      case WEIGHTED_MAJORITY_VOTE:
        break;
      case WEIGHTED_AVERAGE:
        break;
      case MEDIAN:
View Full Code Here

Examples of cascading.pattern.ensemble.selection.Average

    ModelSchema modelSchema = new ModelSchema( expectedFields, predictedFields );

    EnsembleSpec<TreeSpec> ensembleSpec = new EnsembleSpec<TreeSpec>( modelSchema );

    ensembleSpec.setSelectionStrategy( new Average() );

    {
    TreeSpec treeSpec = new TreeSpec( modelSchema );

    Tree tree = new Tree( "1" );
View Full Code Here

Examples of com.aelitis.azureus.core.util.average.Average

       
        Object[]  a_entry = (Object[])ave.get( key );
       
        if ( a_entry != null ){
         
          Average  average = (Average)a_entry[0];
         
          ave_results.put( key + ".average", new Long((long)average.getAverage()));
        }
      }
           
      result.putAll( ave_results );
    }
View Full Code Here

Examples of com.aelitis.azureus.core.util.average.Average

                Object  value   = entry.getValue();
               
                if ( value instanceof Long ){
                 
                  long  last_value;
                  Average  a;
                  boolean  new_average;
                 
                  Object[] a_entry = (Object[])ave.get( key );
                 
                  if ( a_entry == null ){
 
                    a       = AverageFactory.MovingImmediateAverage( 10 );
                    last_value  = 0;
                   
                    a_entry = new Object[]{ a, value };
                   
                    ave.put( key, a_entry );
                   
                    new_averages = new_average = true;
                   
                  }else{
                    a      = (Average)a_entry[0];
                    last_value  = ((Long)a_entry[1]).longValue();
                   
                    new_average = false;
                  }
                 
                  if ( stats_types.get( key ) == CUMULATIVE ){
                 
                      // skip initial value as 'last_value' is invalid
                   
                    if ( !new_average ){
                   
                      a.update(((Long)value).longValue() - last_value);
                    }
                  }else{
                   
                    a.update(((Long)value).longValue());

                  }
                 
                  a_entry[1] = value;
                }
View Full Code Here

Examples of com.aelitis.azureus.core.util.average.Average

        double fastestPing = 10000.0;

        int len = sources.length;
        for(int i=0; i<len; i++){
            PingSourceStats pss = (PingSourceStats) pingAverages.get(sources[i]);
            Average ave = pss.getHistory();
            double pingTime = ave.getAverage();

            //find slowest
            if( pingTime>slowestPing ){
                slowestPing = pingTime;
                slowestSource=sources[i];
View Full Code Here

Examples of com.aelitis.azureus.core.util.average.Average

        double fastB = 10000.0;
        double slowest = 0.0;
        int len = sources.length;
        for(int i=0; i<len; i++){
            PingSourceStats pss = (PingSourceStats) pingAverages.get(sources[i]);
            Average ave = pss.getHistory();
            double pingTime = ave.getAverage();

            //determine fastest or second fastest.
            if(pingTime<fastA){
                fastB=fastA;
                fastA=pingTime;
View Full Code Here

Examples of com.aelitis.azureus.core.util.average.Average

            PingSourceStats pss = (PingSourceStats) pingAverages.get(sources[i]);
           
            if ( pss == null ){
              continue;
            }
            Average a = pss.getLongTermAve();
            double avePingTime = a.getAverage();

            //is this a new highest value?
            if( avePingTime>highestLongTermPing ){
                highestLongTermPing = avePingTime;
                highestSource = sources[i];
View Full Code Here

Examples of com.rackspacecloud.blueflood.types.Average

    @Test
    public void testEquals() {
        Range myRange = new Range(1, 2);
        Range myRange2 = new Range(1, 2);
        Range myRange3 = new Range(2, 3);
        Average avg = new Average(1, 2.0);

        Assert.assertFalse(myRange.equals(avg));
        Assert.assertFalse(myRange.equals(myRange3));
        Assert.assertTrue(myRange.equals(myRange2));
    }
View Full Code Here

Examples of com.rackspacecloud.blueflood.types.Average

    @Test
    public void testEquals() {
        Granularity gran1 = Granularity.MIN_5;
        Granularity gran2 = Granularity.MIN_5;
        Granularity gran3 = Granularity.MIN_1440;
        Average avg = new Average(1, 2.0);

        Assert.assertEquals(gran2, gran1);
        Assert.assertFalse(gran1.equals(gran3));
        Assert.assertFalse(gran1.equals(avg));
    }
View Full Code Here

Examples of org.boris.expr.function.excel.AVERAGE

        assertEquals(TH.eval(a, 1, 2, 3, 4, 5), 1.2);
        assertEquals(eval(a, 4, 5, 6, 7, 5, 4, 3), 1.02040816326531);
    }

    public void testAVERAGE() throws Exception {
        AVERAGE a = new AVERAGE();
        assertEquals(eval(a, 23, 23, 23), 23.);
        assertEquals(eval(a, ExprMissing.MISSING), ExprError.DIV0);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.