edgent-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddebrunner <...@git.apache.org>
Subject [GitHub] incubator-quarks pull request: [QUARKS-107] [WIP] create Simulated...
Date Tue, 05 Apr 2016 23:02:33 GMT
Github user ddebrunner commented on a diff in the pull request:

    --- Diff: samples/utils/src/main/java/quarks/samples/utils/sensor/SimulatedTemperatureSensor.java
    @@ -0,0 +1,110 @@
    +Licensed to the Apache Software Foundation (ASF) under one
    +or more contributor license agreements.  See the NOTICE file
    +distributed with this work for additional information
    +regarding copyright ownership.  The ASF licenses this file
    +to you under the Apache License, Version 2.0 (the
    +"License"); you may not use this file except in compliance
    +with the License.  You may obtain a copy of the License at
    +  http://www.apache.org/licenses/LICENSE-2.0
    +Unless required by applicable law or agreed to in writing,
    +software distributed under the License is distributed on an
    +KIND, either express or implied.  See the License for the
    +specific language governing permissions and limitations
    +under the License.
    +package quarks.samples.utils.sensor;
    +import java.text.DecimalFormat;
    +import java.util.Objects;
    +import java.util.Random;
    +import quarks.analytics.sensors.Range;
    +import quarks.analytics.sensors.Ranges;
    +import quarks.function.Supplier;
    + * A Simulated temperature sensor.
    + * <p>
    + * The sensor starts off with an initial value.
    + * Each call to {@link #get()} changes the current value by
    + * a random amount between plus/minus a {@code deltaFactor}.
    + * The new current value is limited to a {@code maxTempRange}.
    + * <p>
    + * Temperature values are in Fahrenheit.
    --- End diff --
    'Temperature values are in Fahrenheit."
    Isn't that up to whoever is creating an instance?
    The default constructor maps to a normal air temperature Fahrenheit range, but wouldn't
something like this be suitable for Kelvin around the same range?
    `new SimulatedTemperatureSensor(300, Ranges.closed(265, 315), 0.5);`

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.

View raw message