public final class RegressionTestPlan
extends java.lang.Object
implements java.io.Serializable
InputData
you
provide it.
To create a RegressionTestPlan
, use a
RegressionTestPlan.Builder
. In many cases this will simply be a case
of e.g.:
RegressionTestPlan testPlan = new RegressionTestPlan.Builder(
TemperatureUnit.CELSIUS).build();
but there are lots of more advanced options you can configure as well.
See www.degreedays.net/api/regression for more information and code samples. And check the docs for the Builder
class for details on all the configuration
options.
RegressionTestPlan.Builder
Instances of this class are immutable. You can safely reuse them and call them from multiple threads at once.
Modifier and Type | Class and Description |
---|---|
static class |
RegressionTestPlan.Builder
For creating a
RegressionTestPlan object that defines how the API
should test regressions against the InputData you provide it. |
Modifier and Type | Method and Description |
---|---|
DayNormalization |
dayNormalization()
Returns the
DayNormalization to be used in the regression
process. |
boolean |
equals(java.lang.Object o)
Returns
true if o is an
RegressionTestPlan with the same configuration as
this . |
java.util.Set<java.lang.String> |
extraPredictorKeys()
Returns the non-null, possibly-empty set of extra-predictor keys that
this
RegressionTestPlan has ExtraPredictorSpec
objects for. |
java.util.SortedSet<Temperature> |
getCustomTestCoolingBaseTemperatures()
Returns the custom set of base temperatures to be used for the CDD in
regressions tested by the API, or throws an
IllegalStateException if no such base temperatures are
specified (check hasCustomTestCoolingBaseTemperatures() before
calling this). |
java.util.SortedSet<Temperature> |
getCustomTestHeatingBaseTemperatures()
Returns the custom set of base temperatures to be used for the HDD in
regressions tested by the API, or throws an
IllegalStateException if no such base temperatures are
specified (check hasCustomTestHeatingBaseTemperatures() before
calling this). |
ExtraPredictorSpec |
getExtraPredictorSpec(java.lang.String extraPredictorKey)
Returns the non-null
ExtraPredictorSpec associated with the
specified string extraPredictorKey . |
boolean |
hasCustomTestCoolingBaseTemperatures()
Returns
true if a custom set of base temperatures is to be
used for the CDD in the regressions tested by the API, or
false if the API should choose the test cooling base
temperatures automatically. |
boolean |
hasCustomTestHeatingBaseTemperatures()
Returns
true if a custom set of base temperatures is to be
used for the HDD in the regressions tested by the API, or
false if the API should choose the test heating base
temperatures automatically. |
int |
hashCode()
Overridden to ensure consistency with
equals . |
java.util.Set<RegressionSpec> |
requestedRegressionSpecs()
Returns a non-null possibly-empty set of specifications for regressions
that the API is specifically instructed to test and return (on top of any
others that it will test and potentially return anyway).
|
TemperatureUnit |
temperatureUnit()
Returns the non-null
TemperatureUnit that specifies whether
Celsius-based or Fahrenheit-based degree days should be used in
regressions. |
java.lang.String |
toString()
Returns a non-null, non-empty string representation of this object for logging and debugging purposes.
|
public TemperatureUnit temperatureUnit()
TemperatureUnit
that specifies whether
Celsius-based or Fahrenheit-based degree days should be used in
regressions.public DayNormalization dayNormalization()
DayNormalization
to be used in the regression
process.public boolean hasCustomTestHeatingBaseTemperatures()
true
if a custom set of base temperatures is to be
used for the HDD in the regressions tested by the API, or
false
if the API should choose the test heating base
temperatures automatically.
If this returns true
, it is safe to call
getCustomTestHeatingBaseTemperatures()
.
public boolean hasCustomTestCoolingBaseTemperatures()
true
if a custom set of base temperatures is to be
used for the CDD in the regressions tested by the API, or
false
if the API should choose the test cooling base
temperatures automatically.
If this returns true
, it is safe to call
getCustomTestCoolingBaseTemperatures()
.
public java.util.SortedSet<Temperature> getCustomTestHeatingBaseTemperatures()
IllegalStateException
if no such base temperatures are
specified (check hasCustomTestHeatingBaseTemperatures()
before
calling this).
If this returns an empty set, the API will not include HDD in any of its
test regressions (unless requestedRegressionSpecs()
specifies
any regressions with HDD in them).
public java.util.SortedSet<Temperature> getCustomTestCoolingBaseTemperatures()
IllegalStateException
if no such base temperatures are
specified (check hasCustomTestCoolingBaseTemperatures()
before
calling this).
If this returns an empty set, the API will not include CDD in any of its
test regressions (unless requestedRegressionSpecs()
specifies
any regressions with CDD in them).
public java.util.Set<java.lang.String> extraPredictorKeys()
RegressionTestPlan
has ExtraPredictorSpec
objects for.getExtraPredictorSpec(java.lang.String)
,
RegressionTestPlan.Builder.addExtraPredictorSpec(java.lang.String, net.degreedays.api.regression.ExtraPredictorSpec)
,
RegressionTestPlan.Builder.setExtraPredictorSpecs(java.util.Map<java.lang.String, net.degreedays.api.regression.ExtraPredictorSpec>)
public ExtraPredictorSpec getExtraPredictorSpec(java.lang.String extraPredictorKey)
ExtraPredictorSpec
associated with the
specified string extraPredictorKey
.extraPredictorKey
- a non-null, non-empty string key.java.lang.NullPointerException
- if extraPredictorKey
is
null
.java.lang.IllegalArgumentException
- if extraPredictorKey
is not
associated with an ExtraPredictorSpec
in this object.extraPredictorKeys()
,
RegressionTestPlan.Builder.addExtraPredictorSpec(java.lang.String, net.degreedays.api.regression.ExtraPredictorSpec)
,
RegressionTestPlan.Builder.setExtraPredictorSpecs(java.util.Map<java.lang.String, net.degreedays.api.regression.ExtraPredictorSpec>)
public java.util.Set<RegressionSpec> requestedRegressionSpecs()
public boolean equals(java.lang.Object o)
true
if o
is an
RegressionTestPlan
with the same configuration as
this
.equals
in class java.lang.Object
public int hashCode()
equals
.hashCode
in class java.lang.Object
public java.lang.String toString()
The exact details of the representation are unspecified and subject to change.
toString
in class java.lang.Object
See www.degreedays.net/api/ for more about the Degree Days.net API.
You can sign up for a Degree Days.net API account and read the integration guide that is useful and applicable whether you are using Java or not.