Package eu.planets_project.pp.plato.model.values

Examples of eu.planets_project.pp.plato.model.values.PositiveIntegerValue


public class PositiveIntegerScale extends RestrictedScale {

    private static final long serialVersionUID = 7455117412684178182L;

    public PositiveIntegerValue createValue() {
        PositiveIntegerValue v = new PositiveIntegerValue();
        v.setScale(this);
        return v;
    }
View Full Code Here


    @Override
    public boolean isEvaluated(Value value) {
        boolean evaluated = false;
        if ((value != null) && (value instanceof PositiveIntegerValue)) {
            PositiveIntegerValue v = (PositiveIntegerValue)value;

            evaluated = v.isChanged() &&
            (v.getValue() <= getUpperBound() && v.getValue() >= 0 );
        }
        return evaluated;
    }
View Full Code Here

       
        if (OBJECT_ACTION_ACTIVITYLOGGING_AMOUNT.equals(propertyURI)) {
            Map<SampleObject, DetailedExperimentInfo> detailedInfo = alternative.getExperiment().getDetailedInfo();
            DetailedExperimentInfo detailedExperimentInfo = detailedInfo.get(sample);
            if ((detailedExperimentInfo != null) && (detailedExperimentInfo.getProgramOutput() != null)) {
                PositiveIntegerValue v = (PositiveIntegerValue) scale.createValue();
                v.setValue(detailedExperimentInfo.getProgramOutput().length());
                v.setComment("extracted from experiment details");
                return v;
            }
            return null;
        } else if (OBJECT_ACTION_ACTIVITYLOGGING_FORMAT.equals(propertyURI)) {
            Map<SampleObject, DetailedExperimentInfo> detailedInfo = alternative.getExperiment().getDetailedInfo();
            DetailedExperimentInfo detailedExperimentInfo = detailedInfo.get(sample);
            if ((detailedExperimentInfo != null) && (detailedExperimentInfo.getProgramOutput() != null)) {
                FreeStringValue v = (FreeStringValue) scale.createValue();
                v.setValue(evaluateLogging(detailedExperimentInfo.getProgramOutput()));
                v.setComment("extracted from experiments details");
                return v;
            }
            return null;
        } else if (OBJECT_ACTION_RUNTIME_PERFORMANCE_THROUGHPUT.equals(propertyURI)) {
            Value extracted = extractMeasuredValue(alternative, sample, OBJECT_ACTION_RUNTIME_PERFORMANCE_TIME_PERSAMPLE);
View Full Code Here

    trans.setThreshold2((double)1);
    trans.setThreshold3((double)2);
    trans.setThreshold4((double)3);
    trans.setThreshold5((double)4);
    trans.setMode(TransformationMode.THRESHOLD_STEPPING);
    PositiveIntegerValue value = new PositiveIntegerValue();
    value.setValue(0);
    assert (trans.transform(value).getValue()==(double)1);
    value.setValue(1);
    assert (trans.transform(value).getValue()==(double)2);
    value.setValue(2);
    assert (trans.transform(value).getValue()==(double)3);
    value.setValue(3);
    assert (trans.transform(value).getValue()==(double)4);
    value.setValue(4);
    assert (trans.transform(value).getValue()==(double)5);
    value.setValue(5);
    assert (trans.transform(value).getValue()==(double)5);
  }
View Full Code Here

    trans.setThreshold2((double)4);
    trans.setThreshold3((double)3);
    trans.setThreshold4((double)2);
    trans.setThreshold5((double)1);
    trans.setMode(TransformationMode.THRESHOLD_STEPPING);
    PositiveIntegerValue value = new PositiveIntegerValue();
    value.setValue(0);
    assert (trans.transform(value).getValue()==(double)5);
    value.setValue(1);
    assert (trans.transform(value).getValue()==(double)5);
    value.setValue(2);
    assert (trans.transform(value).getValue()==(double)4);
    value.setValue(3);
    assert (trans.transform(value).getValue()==(double)3);
    value.setValue(4);
    assert (trans.transform(value).getValue()==(double)2);
    value.setValue(5);
    assert (trans.transform(value).getValue()==(double)1);
    value.setValue(6);
    assert (trans.transform(value).getValue()==(double)0);
  }
View Full Code Here

    trans.setThreshold2((double)1);
    trans.setThreshold3((double)2);
    trans.setThreshold4((double)3);
    trans.setThreshold5((double)4);
    trans.setMode(TransformationMode.LINEAR);
    PositiveIntegerValue value = new PositiveIntegerValue();
    value.setValue(0);
    assert (trans.transform(value).getValue()==(double)1);
    value.setValue(1);
    assert (trans.transform(value).getValue()==(double)2);
    value.setValue(2);
    assert (trans.transform(value).getValue()==(double)3);
    value.setValue(3);
    assert (trans.transform(value).getValue()==(double)4);
    value.setValue(4);
    assert (trans.transform(value).getValue()==(double)5);
    value.setValue(5);
    assert (trans.transform(value).getValue()==(double)5);
  }
View Full Code Here

TOP

Related Classes of eu.planets_project.pp.plato.model.values.PositiveIntegerValue

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.