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

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


   
    public Measurement(String propertyName, double value) {
        MeasurableProperty p = new MeasurableProperty();
        p.setName(propertyName);
        p.setScale(new PositiveFloatScale());
        PositiveFloatValue v = (PositiveFloatValue) p.getScale().createValue();
        v.setValue(value);
        this.setProperty(p);
        this.setValue(v);
    }
View Full Code Here


    public ScaleType getType() {
        return ScaleType.restricted;
    }
   
    public PositiveFloatValue createValue() {
        PositiveFloatValue v = new PositiveFloatValue();
        v.setScale(this);
        return v;
    }
View Full Code Here

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

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

                // This means that I am not entitled to evaluate this measurementInfo and therefore supposed to skip it:
                continue;
            }
            if (OBJECT_FORMAT_RELATIVEFILESIZE.equals(propertyURI)) {
                // evaluate here
                PositiveFloatValue v = (PositiveFloatValue) scale.createValue();
                double d = ((double)result.getData().getSize())/sample.getData().getSize()*100;
                long l = Math.round(d);
                d = ((double)l)/100;
                v.setValue(d);
                results.put(measurementInfoUri, v);
                listener.updateStatus(String.format("Objectevaluator: evaluated measurement: %s = %s", measurementInfoUri.getAsURI(), v.toString()));
            }
        }
        measurementInfoUris.removeAll(results.keySet());
        FITSEvaluator fitsEval = new FITSEvaluator();
        HashMap<MeasurementInfoUri, Value> fitsResults = fitsEval.evaluate(alternative, sample, result, measurementInfoUris, listener);
View Full Code Here

            for (MeasurableProperty property: getMeasurableProperties()) {
                if (!property.getName().startsWith("machine:")) {
                    Measurement m = new Measurement();
                    m.setProperty(property);
                    PositiveFloatValue v = (PositiveFloatValue) property.getScale().createValue();
                    if (property.getName().equals(MigrationResult.MIGRES_ELAPSED_TIME)) {
                        v.setValue(elapsed);
                        m.setValue(v);
                        result.getMeasurements().put(property.getName(), m);
                    } else if (property.getName().equals(MigrationResult.MIGRES_ELAPSED_TIME_PER_MB)) {
                        v.setValue(elapsedPerMB);
                        m.setValue(v);
                        result.getMeasurements().put(property.getName(), m);
                    } else if (property.getName().equals(MigrationResult.MIGRES_RELATIVE_FILESIZE)) {
                        v.setValue(((double)length)/data.length * 100);
                        m.setValue(v);
                        result.getMeasurements().put(property.getName(), m);
                    } else if (property.getName().equals(MigrationResult.MIGRES_RESULT_FILESIZE)) {
                        v.setValue((double)length);
                        m.setValue(v);
                        result.getMeasurements().put(property.getName(), m);
                    }
                }               
            }
View Full Code Here

        p.parse(makeOutputFilename(config, time)+".hprof");
       
        for (MeasurableProperty property: getMeasurableProperties()) {
            Measurement m = new Measurement();
            m.setProperty(property);
            PositiveFloatValue v = (PositiveFloatValue) property.getScale().createValue();
           
//            if (property.getName().equals(MigrationResult.MIGRES_MEMORY_GROSS)) {
//                v.setValue(p.getTotal_allocated());
//            }
//            if (property.getName().equals(MigrationResult.MIGRES_MEMORY_NET)) {
//                v.setValue(p.getTotal_virtual());
//            }

            if (property.getName().equals(MigrationResult.MIGRES_MEMORY_GROSS)) {
                v.setValue(p.getTotal_allocated());
            }

            /**
             * this is NOT the total virtual memory used during execution
             * it's the virtual memory still allocated when HProf collects information
             * - if garbage collector was called, this value is lower than the actual v-memory consumption
             */
            if (property.getName().equals("performance:totalVirtualMemory")) {
                v.setValue(p.getTotal_virtual());
            }
            if (property.getName().equals("performance:totalAllocatedMemory")) {
                v.setValue(p.getTotal_allocated());
            }
            m.setValue(v);
            result.getMeasurements().put(property.getName(), m);
        }
    }
View Full Code Here

    trans.setThreshold2(new Double(1));
    trans.setThreshold3(new Double(2));
    trans.setThreshold4(new Double(3));
    trans.setThreshold5(new Double(4));
    trans.setMode(TransformationMode.THRESHOLD_STEPPING);
    PositiveFloatValue value = new PositiveFloatValue();
    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);
    PositiveFloatValue value = new PositiveFloatValue();
    value.setValue(0);
    assert (trans.transform(value).getValue()==(double)5);
    value.setValue(0.5);
    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(2.5);
    assert (trans.transform(value).getValue()==(double)3);
    value.setValue(3);
    assert (trans.transform(value).getValue()==(double)3);
    value.setValue(3.5);
    assert (trans.transform(value).getValue()==(double)2);
    value.setValue(3.2);
    assert (trans.transform(value).getValue()==(double)2);
    value.setValue(4);
    assert (trans.transform(value).getValue()==(double)2);
    value.setValue(4.999);
    assert (trans.transform(value).getValue()==(double)1);
    value.setValue(5);
    assert (trans.transform(value).getValue()==(double)1);
    value.setValue(5.1);
    assert (trans.transform(value).getValue()==(double)0);
    value.setValue(6);
    assert (trans.transform(value).getValue()==(double)0);
  }
View Full Code Here

    trans.setThreshold2((double)4);//2
    trans.setThreshold3((double)6);//3
    trans.setThreshold4((double)8);//4
    trans.setThreshold5((double)10);//5
    trans.setMode(TransformationMode.LINEAR);
    PositiveFloatValue value = new PositiveFloatValue();
    value.setValue(0);
    assert (trans.transform(value).getValue()==(double)0 );
    value.setValue(1.9999);
    assert (trans.transform(value).getValue()==(double)0 );
    value.setValue(2);
    assert (trans.transform(value).getValue()==(double)1 );
    value.setValue(3);
    assert (trans.transform(value).getValue()==(double)1.5);
    value.setValue(4);
    assert (trans.transform(value).getValue()==(double)2);
    value.setValue(8.5);
    assert (trans.transform(value).getValue()==(double)4.25);
    value.setValue(10);
    assert (trans.transform(value).getValue()==(double)5);   
    value.setValue(1000000);
    assert (trans.transform(value).getValue()==(double)5);
    value.setValue(-100000);
    assert (trans.transform(value).getValue()==(double)0 );
   
  }
View Full Code Here

            }
            return null;
        } else if (OBJECT_ACTION_RUNTIME_PERFORMANCE_THROUGHPUT.equals(propertyURI)) {
            Value extracted = extractMeasuredValue(alternative, sample, OBJECT_ACTION_RUNTIME_PERFORMANCE_TIME_PERSAMPLE);
            if (extracted instanceof PositiveFloatValue){
                PositiveFloatValue value = new PositiveFloatValue();
                double floatVal =  ((PositiveFloatValue)extracted).getValue();
                if (Double.compare(floatVal, 0.0) !=  0) {
                    // calculate msec/MB
                    floatVal = floatVal / sampleSize;
                    // throughput is defined in MB per second, time/perMB is msec/MB
                    value.setValue((1.0/(floatVal/1000.0)));
                }
                value.setComment("extracted from experiment details");
                return value;
            }
        } else if (OBJECT_ACTION_RUNTIME_PERFORMANCE_TIME_PERMB.equals(propertyURI)) {
            Value extracted = extractMeasuredValue(alternative, sample, OBJECT_ACTION_RUNTIME_PERFORMANCE_TIME_PERSAMPLE);
            if (extracted instanceof PositiveFloatValue){
                PositiveFloatValue value = new PositiveFloatValue();
                double floatVal =  ((PositiveFloatValue)extracted).getValue();
                if (Double.compare(floatVal, 0.0) !=  0) {
                    // calculate msec/MB
                    floatVal = floatVal / sampleSize;
                    value.setValue(floatVal);
                }
                value.setComment("extracted from experiment details");
                return value;
            }
        } else if(OBJECT_ACTION_RUNTIME_PERFORMANCE_MEMORY_PERMB.equals(propertyURI)) {
            Value extracted = extractMeasuredValue(alternative, sample, OBJECT_ACTION_RUNTIME_PERFORMANCE_MEMORY_PERSAMPLE);
            if (extracted instanceof PositiveFloatValue) {
                PositiveFloatValue value = new PositiveFloatValue();
                double floatVal = ((PositiveFloatValue)extracted).getValue();
               
                value.setValue(floatVal / sampleSize);
                value.setComment("extracted from experiment details");
                return value;
            }
        }
        Value extracted = extractMeasuredValue(alternative, sample, propertyURI);
        if (extracted != null) {
View Full Code Here

TOP

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

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.