Line data Source code
1 : /* 2 : * Copyright (C) 2020-2024 MEmilio 3 : * 4 : * Authors: Daniel Abele, Elisabeth Kluth, Khoa Nguyen 5 : * 6 : * Contact: Martin J. Kuehn <Martin.Kuehn@DLR.de> 7 : * 8 : * Licensed under the Apache License, Version 2.0 (the "License"); 9 : * you may not use this file except in compliance with the License. 10 : * You may obtain a copy of the License at 11 : * 12 : * http://www.apache.org/licenses/LICENSE-2.0 13 : * 14 : * Unless required by applicable law or agreed to in writing, software 15 : * distributed under the License is distributed on an "AS IS" BASIS, 16 : * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 : * See the License for the specific language governing permissions and 18 : * limitations under the License. 19 : */ 20 : #include "abm/lockdown_rules.h" 21 : #include "abm/parameters.h" 22 : #include "abm/person.h" 23 : #include "abm/time.h" 24 : 25 : namespace mio 26 : { 27 : namespace abm 28 : { 29 : 30 27 : void set_home_office(TimePoint t_begin, double p, Parameters& params) 31 : { 32 27 : auto damping1 = Eigen::VectorXd::Constant(1, p); 33 27 : params.get<WorkRatio>().add_damping(damping1, SimulationTime(t_begin.days())); 34 27 : } 35 : 36 27 : void set_school_closure(TimePoint t_begin, double p, Parameters& params) 37 : { 38 27 : auto damping1 = Eigen::VectorXd::Constant(1, p); 39 27 : params.get<SchoolRatio>().add_damping(damping1, SimulationTime(t_begin.days())); 40 27 : } 41 : 42 27 : void close_social_events(TimePoint t_begin, double p, Parameters& params) 43 : { 44 27 : auto damping1 = Eigen::VectorXd::Constant(params.get_num_groups(), p); 45 27 : params.get<SocialEventRate>().add_damping(damping1, SimulationTime(t_begin.days())); 46 27 : } 47 : 48 : } // namespace abm 49 : } // namespace mio