Skip to content

Commit

Permalink
Created TestHGTRVHPModelSoftATemperature.
Browse files Browse the repository at this point in the history
  • Loading branch information
DamonHD committed Sep 22, 2023
1 parent 626a4c3 commit 1228ab4
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions test/javasrc/localtest/TestHGTRVHPModelSoftATemperature.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
Copyright (c) 2023, Damon Hart-Davis
Licensed 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 "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package localtest;

import org.hd.d.TRVmodel.hg.HGTRVHPMModelParameterised;
import org.hd.d.TRVmodel.hg.HGTRVHPMModelParameterised.DemandWithoutAndWithSetback;

import junit.framework.TestCase;

/**Test the parameterised Heat Geek TRV-with-HP model with soft A-room temperatures. */
public final class TestHGTRVHPModelSoftATemperature extends TestCase
{
/**Test with 'fix' parameters but otherwise original setup. */
public static void testWithFixParameters()
{
final HGTRVHPMModelParameterised.ModelParameters fixParams = HGTRVHPMModelParameterised.ModelParameters.FIXES_APPLIED;
final DemandWithoutAndWithSetback originalBungalowDemand = HGTRVHPMModelParameterised.computeBungalowDemandW(fixParams);
// final DemandWithoutAndWithSetback detachedDemand = HGTRVHPMModelParameterised.computeDetachedDemandW(fixParams);
final DemandWithoutAndWithSetback softBungalowDemand = HGTRVHPMModelParameterised.computeSoftATempDemandW(fixParams, true);
// final DemandWithoutAndWithSetback softDetachedDemand = HGTRVHPMModelParameterised.computeSoftATempDemandW(fixParams, true);

// Both heat demand and heat-pump electricity demand are expected to be identical to the original
// without B rooms set back.
assertEquals(originalBungalowDemand.noSetback().heatDemand(), softBungalowDemand.noSetback().heatDemand(), 1.0);
assertEquals(originalBungalowDemand.noSetback().heatPumpElectricity(), softBungalowDemand.noSetback().heatPumpElectricity(), 1.0);


// Both heat demand and heat-pump electricity demand are expected to be strictly lower than the original
// when B rooms are set back and A rooms have soft temperature regulation (weather compensation).
// assertTrue(softBungalowDemand.


}

}

0 comments on commit 1228ab4

Please sign in to comment.