Package uk.org.ogsadai.activity.io

Examples of uk.org.ogsadai.activity.io.ActivityInput


         BlockReader data = getInput(INPUT_DATA);
         if (data == null)
         {
             throw new InvalidActivityInputsException(1, INPUT_DATA);
         }  
         ActivityInput dataInput = new TupleListActivityInput(INPUT_DATA);
         dataInput.setBlockReader(data);
         inputs.add(dataInput);
        
         BlockReader priorities = getInput(INPUT_PRIORITIES);
         if (priorities == null)
         {
             throw new InvalidActivityInputsException(1, INPUT_PRIORITIES);
         }  
         ActivityInput prioritiesInput = new TypedListActivityInput(INPUT_PRIORITIES, Object.class);
         prioritiesInput.setBlockReader(priorities);
         inputs.add(prioritiesInput);
        
         List<BlockReader> classifiers = getInputs(INPUT_CLASSIFIER);
         for (BlockReader reader : classifiers)
         {
             // can be either column index or column name
             ActivityInput input = new TypedActivityInput(INPUT_CLASSIFIER, TupleClassifier.class);
             input.setBlockReader(reader);
             inputs.add(input);
         }       
         return inputs.toArray(new ActivityInput[inputs.size()]);
    }
View Full Code Here


        List<ActivityInput> inputs = new ArrayList<ActivityInput>();
       
        // set up block reader for items input
        BlockReader items = getInput(INPUT_ITEMS);

        ActivityInput itemsInput = new TupleListActivityInput(INPUT_ITEMS);
        itemsInput.setBlockReader(items);
        inputs.add(itemsInput);
       
        // set up block reader for customers input
        BlockReader customers = getInput(INPUT_TRANSACTIONS);
 
        ActivityInput customersInput = new TupleListActivityInput(INPUT_TRANSACTIONS);
        customersInput.setBlockReader(customers);
        inputs.add(customersInput);
       
       
        // set up block reader for customers input
        BlockReader key = getInput(INPUT_KEY_INDEX);
 
        ActivityInput keyIndexInput = new TypedActivityInput(INPUT_KEY_INDEX, Integer.class);
        keyIndexInput.setBlockReader(key);
        inputs.add(keyIndexInput);
       
        return inputs.toArray(new ActivityInput[inputs.size()]);
       
       
View Full Code Here

        BlockReader data = getInput(INPUT_DATA);
        if (data == null)
        {
            throw new InvalidActivityInputsException(1, INPUT_DATA);
        }  
        ActivityInput dataInput = new TupleListActivityInput(INPUT_DATA);
        dataInput.setBlockReader(data);
        inputs.add(dataInput);

        // set up block reader for options input
        BlockReader options = getInput(INPUT_OPTIONS);

        TypedOptionalActivityInput optionsInput =
            new TypedOptionalActivityInput(INPUT_OPTIONS, Object.class, DEFAULT_OPTIONS);
        optionsInput.setBlockReader(options);
        inputs.add(optionsInput);
       
        // set up block reader for options input
        BlockReader algorithm = getInput(INPUT_ALGORITHM_CLASS);
       
        TypedOptionalActivityInput algorithmInput =
            new TypedOptionalActivityInput(INPUT_ALGORITHM_CLASS, Object.class, DEFAULT_ALGORITHM);
        algorithmInput.setBlockReader(algorithm);
        inputs.add(algorithmInput);
       
        // set up block reader for indexes of nominal values columns
        BlockReader indexes = getInput(INPUT_COLUMN_INDICES);
        if (indexes == null)
        {
            throw new InvalidActivityInputsException(1, INPUT_COLUMN_INDICES);
        }  
        ActivityInput nomValIndexesInput = new TypedListActivityInput(INPUT_COLUMN_INDICES, Object.class);
        nomValIndexesInput.setBlockReader(indexes);
        inputs.add(nomValIndexesInput);
       
        // set up inputs for columns with nominal values
        List<BlockReader> nomVals = (List<BlockReader>)getInputs(INPUT_NOMINAL_VALUES);
        for (BlockReader reader : nomVals)
        {
            // can be either column index or column name
            ActivityInput input = new TypedListActivityInput(INPUT_NOMINAL_VALUES, Object.class);
            input.setBlockReader(reader);
            inputs.add(input);
        }
        return inputs.toArray(new ActivityInput[inputs.size()]);
    }
View Full Code Here

         BlockReader data = getInput(INPUT_DATA);
         if (data == null)
         {
             throw new InvalidActivityInputsException(1, INPUT_DATA);
         }  
         ActivityInput dataInput = new TupleListActivityInput(INPUT_DATA);
         dataInput.setBlockReader(data);
         inputs.add(dataInput);
        
         BlockReader priorities = getInput(INPUT_PRIORITIES);
         if (priorities == null)
         {
             throw new InvalidActivityInputsException(1, INPUT_PRIORITIES);
         }  
         ActivityInput prioritiesInput = new TypedListActivityInput(INPUT_PRIORITIES, Object.class);
         prioritiesInput.setBlockReader(priorities);
         inputs.add(prioritiesInput);
        
         List<BlockReader> classifiers = getInputs(INPUT_CLASSIFIER);
         for (BlockReader reader : classifiers)
         {
             // can be either column index or column name
             ActivityInput input = new TypedActivityInput(INPUT_CLASSIFIER, TupleClassifier.class);
             input.setBlockReader(reader);
             inputs.add(input);
         }       
         return inputs.toArray(new ActivityInput[inputs.size()]);
    }
View Full Code Here

    // set up block reader for data input
    BlockReader data = getInput(INPUT_DATA);
    if (data == null) {
      throw new InvalidActivityInputsException(1, INPUT_DATA);
    }
    ActivityInput dataInput = new TupleListActivityInput(INPUT_DATA);
    dataInput.setBlockReader(data);
    inputs.add(dataInput);

    // set up block reader for class index input
    BlockReader classIndex = getInput(INPUT_CLASS_INDEX);
    if (classIndex == null) {
      throw new InvalidActivityInputsException(1, INPUT_CLASS_INDEX);
    }
    ActivityInput classIndexInput = new TypedActivityInput(
        INPUT_CLASS_INDEX, Object.class);
    classIndexInput.setBlockReader(classIndex);
    inputs.add(classIndexInput);

    // set up block reader for indexes of nominal values columns
    BlockReader indexes = getInput(INPUT_COLUMN_INDICES);
    if (indexes == null) {
      throw new InvalidActivityInputsException(1, INPUT_COLUMN_INDICES);
    }
    ActivityInput nomValIndexesInput = new TypedListActivityInput(
        INPUT_COLUMN_INDICES, Object.class);
    nomValIndexesInput.setBlockReader(indexes);
    inputs.add(nomValIndexesInput);

    // set up inputs for columns with nominal values
    List<BlockReader> nomVals = getInputs(INPUT_NOMINAL_VALUES);
    for (BlockReader reader : nomVals) {
      // can be either column index or column name
      ActivityInput input = new TypedListActivityInput(
          INPUT_NOMINAL_VALUES, Object.class);
      input.setBlockReader(reader);
      inputs.add(input);
    }

    return inputs.toArray(new ActivityInput[inputs.size()]);
  }
View Full Code Here

        BlockReader data = getInput(INPUT_DATA);
        if (data == null)
        {
            throw new InvalidActivityInputsException(1, INPUT_DATA);
        }  
        ActivityInput dataInput = new TupleListActivityInput(INPUT_DATA);
        dataInput.setBlockReader(data);
        inputs.add(dataInput);
       
        // set up block reader for class index input
        BlockReader classIndex = getInput(INPUT_CLASS_INDEX);
        if (classIndex == null)
        {
            throw new InvalidActivityInputsException(1, INPUT_CLASS_INDEX);
        }  
        ActivityInput classIndexInput = new TypedActivityInput(INPUT_CLASS_INDEX, Object.class);
        classIndexInput.setBlockReader(classIndex);
        inputs.add(classIndexInput);
       
        // set up block reader for options  input

        BlockReader options = getInput(INPUT_OPTIONS);
        TypedOptionalActivityInput optionsInput = new TypedOptionalActivityInput(INPUT_OPTIONS, Object.class);
        optionsInput.setBlockReader(options);
        inputs.add(optionsInput);
       
        // set up block reader for indexes of nominal values columns
        BlockReader indexes = getInput(INPUT_COLUMN_INDICES);
        if (indexes == null)
        {
            throw new InvalidActivityInputsException(1, INPUT_COLUMN_INDICES);
        }  
        ActivityInput nomValIndexesInput = new TypedListActivityInput(INPUT_COLUMN_INDICES, Object.class);
        nomValIndexesInput.setBlockReader(indexes);
        inputs.add(nomValIndexesInput);
       
        // set up inputs for columns with nominal values
        List<BlockReader> nomVals = getInputs(INPUT_NOMINAL_VALUES);
        for (BlockReader reader : nomVals)
        {
            // can be either column index or column name
            ActivityInput input = new TypedListActivityInput(INPUT_NOMINAL_VALUES, Object.class);
            input.setBlockReader(reader);
            inputs.add(input);
        }
        return inputs.toArray(new ActivityInput[inputs.size()]);
    }
View Full Code Here

        List<ActivityInput> inputs = new ArrayList<ActivityInput>();
       
        // set up block reader for items input
        BlockReader items = getInput(INPUT_ITEM_LIST);

        ActivityInput itemsInput = new TupleListActivityInput(INPUT_ITEM_LIST);
        itemsInput.setBlockReader(items);
        inputs.add(itemsInput);
       
        // set up block reader for customers input
        BlockReader customers = getInput(INPUT_CUSTOMERS_LIST);
 
        ActivityInput customersInput = new TupleListActivityInput(INPUT_CUSTOMERS_LIST);
        customersInput.setBlockReader(customers);
        inputs.add(customersInput);
       
       
        // set up block reader for customers input
        BlockReader key = getInput(INPUT_KEY_INDEX);
 
        ActivityInput keyIndexInput = new TypedActivityInput(INPUT_KEY_INDEX, Integer.class);
        keyIndexInput.setBlockReader(key);
        inputs.add(keyIndexInput);
       
        return inputs.toArray(new ActivityInput[inputs.size()]);
       
       
View Full Code Here

        BlockReader data = getInput(INPUT_DATA);
        if (data == null)
        {
            throw new InvalidActivityInputsException(1, INPUT_DATA);
        }  
        ActivityInput dataInput = new TupleListActivityInput(INPUT_DATA);
        dataInput.setBlockReader(data);
        inputs.add(dataInput);

        // set up block reader for options input
        BlockReader options = getInput(INPUT_OPTIONS);

        TypedOptionalActivityInput optionsInput =
            new TypedOptionalActivityInput(INPUT_OPTIONS, Object.class, DEFAULT_OPTIONS);
        optionsInput.setBlockReader(options);
        inputs.add(optionsInput);
       

       
       
       
        BlockReader outputFreq = getInput(INPUT_OUTPUT_FREQUENCY);

        TypedOptionalActivityInput outputFreqInput =
            new TypedOptionalActivityInput(INPUT_OUTPUT_FREQUENCY, Object.class, 100000);
        outputFreqInput.setBlockReader(outputFreq);
        inputs.add(outputFreqInput);
       
        BlockReader algorithm = getInput(INPUT_ALGORITHM);
        TypedOptionalActivityInput algorithmInput =
            new TypedOptionalActivityInput(INPUT_ALGORITHM, Object.class, DEFAULT_ALGORITHM);
        algorithmInput.setBlockReader(algorithm);
        inputs.add(algorithmInput);
        // set up block reader for indexes of nominal values columns
        BlockReader indexes = getInput(INPUT_COLUMN_INDICES);
        TypedOptionalListActivityInput nomValIndexesInput = new TypedOptionalListActivityInput(INPUT_COLUMN_INDICES, Number.class);
        if(nomValIndexesInput != null && indexes != null)
          nomValIndexesInput.setBlockReader(indexes);
        inputs.add(nomValIndexesInput);
       
        // set up inputs for columns with nominal values
        List<BlockReader> nomVals = (List<BlockReader>)getInputs(INPUT_NOMINAL_VALUES);
        for (BlockReader reader : nomVals)
        {
            // can be either column index or column name
            ActivityInput input = new TypedListActivityInput(INPUT_NOMINAL_VALUES, Object.class);
            input.setBlockReader(reader);
            inputs.add(input);
        }
        LOG.debug("InputSize: " + inputs.size());
        return inputs.toArray(new ActivityInput[inputs.size()]);
  }
View Full Code Here

        BlockReader data = getInput(INPUT_DATA);
        if (data == null)
        {
            throw new InvalidActivityInputsException(1, INPUT_DATA);
        }  
        ActivityInput dataInput = new TupleListActivityInput(INPUT_DATA);
        dataInput.setBlockReader(data);
        inputs.add(dataInput);

        // set up block reader for options input
        BlockReader options = getInput(INPUT_OPTIONS);

        TypedOptionalActivityInput optionsInput =
            new TypedOptionalActivityInput(INPUT_OPTIONS, Object.class, DEFAULT_OPTIONS);
        optionsInput.setBlockReader(options);
        inputs.add(optionsInput);
       
        // set up block reader for options input
        BlockReader algorithm = getInput(INPUT_ALGORITHM_CLASS);
       
        TypedOptionalActivityInput algorithmInput =
            new TypedOptionalActivityInput(INPUT_ALGORITHM_CLASS, Object.class, DEFAULT_ALGORITHM);
        algorithmInput.setBlockReader(algorithm);
        inputs.add(algorithmInput);
       
        // set up block reader for indexes of nominal values columns
        BlockReader indexes = getInput(INPUT_COLUMN_INDICES);
        TypedOptionalListActivityInput nomValIndexesInput = new TypedOptionalListActivityInput(INPUT_COLUMN_INDICES, Number.class);
        if(nomValIndexesInput != null && indexes != null)
          nomValIndexesInput.setBlockReader(indexes);
        inputs.add(nomValIndexesInput);
       
        // set up inputs for columns with nominal values
        List<BlockReader> nomVals = (List<BlockReader>)getInputs(INPUT_NOMINAL_VALUES);
        for (BlockReader reader : nomVals)
        {
            // can be either column index or column name
            ActivityInput input = new TypedListActivityInput(INPUT_NOMINAL_VALUES, Object.class);
            input.setBlockReader(reader);
            inputs.add(input);
        }
        return inputs.toArray(new ActivityInput[inputs.size()]);
    }
View Full Code Here

TOP

Related Classes of uk.org.ogsadai.activity.io.ActivityInput

Copyright © 2018 www.massapicom. 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.