Package uk.org.ogsadai.activity.io

Examples of uk.org.ogsadai.activity.io.TupleListIterator.nextValue()


        Tuple tuple;
        List<String> binNames = getBinNames((ListIterator)iterationInputs[1]);
        List<Double> aggregates = getAggregates((TupleListIterator)iterationInputs[2]);
        mOutput.write(ControlBlock.LIST_BEGIN);
        mOutput.write(prepareMetadata(dataTuples));
        while((tuple = (Tuple)dataTuples.nextValue()) != null) {
          ArrayList<String> list = new ArrayList<String>();
          list.add(getBinName(tuple, binNames, aggregates));
          mOutput.write(new SimpleTuple(list));
        }
        mOutput.write(ControlBlock.LIST_END);
View Full Code Here


            }
           
            TupleMetadata outMetadata = new SimpleTupleMetadata(Collections.singletonList(column));
            mOutput.write(new MetadataWrapper(outMetadata));
            Tuple tuple;
            while ((tuple = (Tuple)tuples.nextValue()) != null)
            {
               
               
                Object result = classify(classifiers, tuple);
               
View Full Code Here

        TupleListIterator tuples = (TupleListIterator)iterationData[0];
        TupleMetadata metadata =
            (TupleMetadata)tuples.getMetadataWrapper().getMetadata();
        Tuple tuple;
        Mean[] calc = getMeanCalculator(metadata);
        while ((tuple = (Tuple)tuples.nextValue()) != null)
        {
            for (int i = 0; i < calc.length; i++)
            {
                calc[i].process(tuple);
            }
View Full Code Here

        try
        {  
            Tuple tuple;
            boolean haveWrittenMetadata = false;
            mOutput.write(ControlBlock.LIST_BEGIN);
            while ((tuple = (Tuple)tuples.nextValue()) != null)
            {
                command = new StringBuffer();
                command.append(base);
                for (int i=0; i<tuple.getColumnCount(); i++)
                {
View Full Code Here

       BlockWriter meanOut = getOutput(MEAN);
       mMetadataOutputBlockWriter = getOutput(METADATA);
       List<ResponsePAZ> responses=new ArrayList<ResponsePAZ>()
       int i=0;
       parametersMap = new HashMap<String,String>();
       while((tuple= (Tuple)tupleListIterator.nextValue())!= null){
         System.out.println("in iteration tuple");
        ResponsePAZ response= new ResponsePAZ();
        response.setName(tuple.getString(tupleMetadata,NAME));
        response.setGain(tuple.getDouble(tupleMetadata,GAIN));
        response.setGainFreq(tuple.getDouble(tupleMetadata,GAIN_FREQUENCY));
View Full Code Here

  ActivityUserException {
    TupleListIterator tuples = (TupleListIterator) iterationData[0];

    Tuple tuple = null;

    while ((tuple = (Tuple) tuples.nextValue()) != null)
    {               
      // add the feature into the classifier
      double[] features= (double[]) tuple.getObject(0);
      classifier.addFeatures(features);
      LOG.debug("Features: size " + features.length + " [0] " + features[0]);
View Full Code Here

            //mOutput.write(ControlBlock.LIST_BEGIN);

          Queue<Integer> randomIndexes = randomNumbers(sampleRepeat, sampleSize);
            Tuple tuple;
           
            for (long i=0;(tuple = (Tuple)tuples.nextValue()) != null;i++)
            {
              if(randomIndexes.size()>0 && i% sampleRepeat == randomIndexes.peek().intValue()){
                sampleTuples[sampleSize - randomIndexes.size()] = tuple;
                randomIndexes.poll();
               
View Full Code Here

        Tuple tuple;
        List<String> binNames = getBinNames((ListIterator)iterationInputs[1]);
        List<Double> aggregates = getAggregates((TupleListIterator)iterationInputs[2]);
        mOutput.write(ControlBlock.LIST_BEGIN);
        mOutput.write(prepareMetadata(dataTuples));
        while((tuple = (Tuple)dataTuples.nextValue()) != null) {
          ArrayList<String> list = new ArrayList<String>();
          list.add(getBinName(tuple, binNames, aggregates));
          mOutput.write(new SimpleTuple(list));
        }
        mOutput.write(ControlBlock.LIST_END);
View Full Code Here

            }
           
            TupleMetadata outMetadata = new SimpleTupleMetadata(Collections.singletonList(column));
            mOutput.write(new MetadataWrapper(outMetadata));
            Tuple tuple;
            while ((tuple = (Tuple)tuples.nextValue()) != null)
            {
               
               
                Object result = classify(classifiers, tuple);
               
View Full Code Here

                column = new SimpleColumnMetadata(resultColumnName, TupleTypes._STRING, 0, 0, 0);
            }
            TupleMetadata outMetadata = new SimpleTupleMetadata(Collections.singletonList(column));
            mOutput.write(new MetadataWrapper(outMetadata));
            Tuple tuple;
            while ((tuple = (Tuple)tuples.nextValue()) != null)
            {
                Object result;
                if (isNumeric)
                {
                    result = classifier.classifyNumeric(tuple);
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.