diff --git a/tests/test_object_creation.py b/tests/test_object_creation.py index 309ef56..592013a 100644 --- a/tests/test_object_creation.py +++ b/tests/test_object_creation.py @@ -1,6 +1,8 @@ import pytest -from ramp import User, Appliance +from ramp import UseCase, User, Appliance +from ramp.example.input_file_1 import User_list +from copy import deepcopy @pytest.fixture @@ -42,3 +44,25 @@ def test_skip_add_existing_appliances_to_user(test_user): test_user.add_appliance(appliance1) assert len(test_user.App_list) == 1 + + +def test_random_seed_initialization(): + # Build use case 2 and fixed random seed + uc_1 = UseCase( + users=deepcopy(User_list), + random_seed=1, + date_start="2020-01-01", + date_end="2020-01-01", + ) + # Initialize and generate load profile + uc_1.initialize(peak_enlarge=0.15, num_days=1) + uc_1_lp = uc_1.generate_daily_load_profiles() + + # Build use case 2 and same fixed random seed as uc_1 + uc_2 = UseCase(users=deepcopy(User_list), random_seed=1) + + # Initialize and generate load profile + uc_2.initialize(peak_enlarge=0.15, num_days=1) + uc_2_lp = uc_2.generate_daily_load_profiles() + + assert (uc_1_lp - uc_1_lp == 0).all()