ALMaSS Rabbit ODdox  1.1
The rabbit model description following ODdox protocol
map_cfg.cpp
Go to the documentation of this file.
1 //
2 // map_cfg.h
3 //
4 /*
5 *******************************************************************************************************
6 Copyright (c) 2011, Christopher John Topping, University of Aarhus
7 All rights reserved.
8 
9 Redistribution and use in source and binary forms, with or without modification, are permitted provided
10 that the following conditions are met:
11 
12 Redistributions of source code must retain the above copyright notice, this list of conditions and the
13 following disclaimer.
14 Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
15 the following disclaimer in the documentation and/or other materials provided with the distribution.
16 
17 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
18 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
19 FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
20 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
22 BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 ********************************************************************************************************
26 */
27 
28 //
29 //
30 // CAUTION!
31 //
32 // This file does not show all the possible configuration variables.
33 // Local ones are placed in the individual .cpp files to conserve
34 // compiler resources.
35 //
36 
37 #include "configurator.h"
38 #include "tov_declaration.h"
39 
40 // Whether to test a single crop in stand alone mode, or run normally.
41 // Set to false in production code.
42 //CfgBool g_farm_test_crop( "FARM_TEST_CROP", CFG_CUSTOM, false );
43 
44 // The numbers come from /docs/CropNumbers.txt.
45 // Eg. '22' is WinterRape.
46 CfgInt g_farm_test_crop_type( "FARM_TEST_CROP_TYPE",
47  CFG_CUSTOM, 22 );
48 CfgStr g_farm_test_crop_filename( "FARM_TEST_CROP_FILENAME",
49  CFG_CUSTOM,
50  "OWinterRape_plant_1.txt" );
51 CfgInt g_farm_test_crop_daystorun("FARM_TEST_CROP_DAYSTORUN",
52  CFG_CUSTOM, 36500 );
53 CfgBool g_farm_test_crop_reportdaily("FARM_TEST_CROP_REPORTDAILY",
54  CFG_CUSTOM, false );
55 
56 // Number is the same as used in the farm reference files and
57 // Landscape::CreateFarms()
58 // 1: ConventionalPig
59 // 2: ConventionalPlant
60 // 3: OrganicCattle
61 // 4: OrganicPig
62 // 5: OrganicPlant
63 // 6: PesticideTrialControl
64 // 7: PesticideTrialToxicControl
65 // 8: PesticideTrialTreatment
66 // 9: ConvMarginalJord
67 // 10: AgroChemIndustryCerealFarm1
68 // 11: AgroChemIndustryCerealFarm2
69 // 12: AgroChemIndustryCerealFarm3
70 // 13: NoPesticideBaseFarm
71 // 14: NoPesticideNoPFarm
72 //....
73 // 18: TestFarm1
74 // 19: TestFarm2
75 // 20: TestFarm3
76 // 21: TestFarm4
77 // 22: TestFarm5
78 // 23: TestFarm6
79 CfgInt g_farm_test_crop_farmtype("FARM_TEST_CROP_FARMTYPE",
80  CFG_CUSTOM, 5 );
81 // The coordinate we will be picking the farming events from.
82 // Need to be adjusted for the particular map we will be using.
83 CfgInt g_farm_test_crop_sample_x("FARM_TEST_CROP_SAMPLE_X",
84  CFG_CUSTOM, 1328 );
85 CfgInt g_farm_test_crop_sample_y("FARM_TEST_CROP_SAMPLE_Y",
86  CFG_CUSTOM, 1328 );
87 
88 
89 // Wether to enable covering *all* farming fields with
90 // a single crop, specified below. This setting, if true,
91 // overrides FARM_ENABLE_CROP_ROTATION, ie. rotation will
92 // always be turned off if this setting is true.
93 CfgBool g_farm_fixed_crop_enable("FARM_FIXED_CROP_ENABLE",
94  CFG_CUSTOM, false );
95 
96 // The fixed crop to use if enabled above.
97 // The numbers come from /docs/CropNumbers.txt.
98 // Eg. '22' is WinterRape.
99 CfgInt g_farm_fixed_crop_type( "FARM_FIXED_CROP_TYPE",
100  CFG_CUSTOM,
101  22 );
102 
103 // Enabling rotation globally.
104 CfgBool g_farm_enable_crop_rotation("FARM_ENABLE_CROP_ROTATION",
105  CFG_CUSTOM, true );
106 
107 // Setting all rotations to be the same on all fields and run in sync.
108 CfgBool g_farm_fixed_rotation_enable("FARM_FIXED_ROTATION_ENABLE",
109  CFG_CUSTOM, false );
110 // If FARM_FIXED_ROTATION_ENABLE is true above, this flag
111 // will allow each farm to run its rotation out of sync
112 // with the others. Ie. each farm selects its own, independent
113 // index in the fixed rotation selected by FARM_FIXED_ROTATION_FARMTYPE
114 // below.
115 CfgBool g_farm_fixed_rotation_farms_async("FARM_FIXED_ROTATION_FARMS_ASYNC",
116  CFG_CUSTOM, false );
117 
118 // Precisely which rotation scheme to run. Counted from zero!
119 // The current list of choices is:
120 //
121 // 0: ConventionalCattle
122 // 1: ConventionalPig
123 // 2: ConventionalPlant
124 // 3: OrganicCattle
125 // 4: OrganicPig
126 // 5: OrganicPlant
127 // 6: PesticideTrialControl
128 // 7: PesticideTrialToxicControl
129 // 8: PesticideTrialTreatment
130 // 9: ConvMarginalJord
131 // 10: AgroChemIndustryCerealFarm1
132 // 11: AgroChemIndustryCerealFarm2
133 // 12: AgroChemIndustryCerealFarm3
134 // 13: NoPesticideBaseFarm
135 // 14: NoPesticideNoPFarm
136 //....
137 // 18: TestFarm1
138 // 19: TestFarm2
139 // 20: TestFarm3
140 // 21: TestFarm4
141 // 22: TestFarm5
142 // 23: TestFarm6
143 
148 CfgInt g_farm_fixed_rotation_farmtype("FARM_FIXED_ROTATION_FARMTYPE", CFG_CUSTOM, 0);
149 
154 CfgBool g_map_le_borders("MAP_LE_BORDERS", CFG_CUSTOM, false);
155 
159 CfgInt g_map_le_borders_min_field_size("MAP_LE_BORDERS_MIN_FIELD_SIZE", CFG_CUSTOM, 10000);
160 
166 CfgInt g_map_le_borderstype("MAP_LE_BORDERSTYPE", CFG_CUSTOM, 160);
167 
171 CfgBool g_map_le_borderremoval( "MAP_LE_BORDERREMOVAL", CFG_CUSTOM, false );
172 
177 CfgBool g_map_orchards_borders( "MAP_ORCHARDS_BORDERS", CFG_CUSTOM, false );
178 
182 CfgInt g_map_le_borderwidth("MAP_LE_BORDER_WIDTH", CFG_CUSTOM, 1);
183 
187 CfgInt g_map_orchardsborderwidth("MAP_ORCHARDS_BORDER_WIDTH", CFG_CUSTOM, 5);
188 
192 CfgInt g_map_le_border_chance( "MAP_LE_BORDER_CHANCE", CFG_CUSTOM, 25 );
193 // Unsprayed margins code...
194 CfgInt g_map_le_unsprayedmargins_chance( "MAP_LE_UMARGIN_CHANCE", CFG_CUSTOM,25 );
195 CfgBool g_map_le_unsprayedmargins( "MAP_LE_UNSPRAYEDMARGINS", CFG_CUSTOM,false );
196 // ...to here
197 
198 
202 CfgInt g_map_maxpolyref( "MAP_MAX_POLYREF", CFG_PUBLIC, 200000 );
203 
g_map_le_borderwidth
CfgInt g_map_le_borderwidth("MAP_LE_BORDER_WIDTH", CFG_CUSTOM, 1)
g_map_maxpolyref
CfgInt g_map_maxpolyref("MAP_MAX_POLYREF", CFG_PUBLIC, 200000)
g_farm_test_crop_reportdaily
CfgBool g_farm_test_crop_reportdaily("FARM_TEST_CROP_REPORTDAILY", CFG_CUSTOM, false)
g_map_le_borders_min_field_size
CfgInt g_map_le_borders_min_field_size("MAP_LE_BORDERS_MIN_FIELD_SIZE", CFG_CUSTOM, 10000)
g_map_orchardsborderwidth
CfgInt g_map_orchardsborderwidth("MAP_ORCHARDS_BORDER_WIDTH", CFG_CUSTOM, 5)
g_map_le_borders
CfgBool g_map_le_borders("MAP_LE_BORDERS", CFG_CUSTOM, false)
CfgStr
String configurator entry class.
Definition: configurator.h:144
g_farm_test_crop_type
CfgInt g_farm_test_crop_type("FARM_TEST_CROP_TYPE", CFG_CUSTOM, 22)
g_farm_fixed_rotation_farms_async
CfgBool g_farm_fixed_rotation_farms_async("FARM_FIXED_ROTATION_FARMS_ASYNC", CFG_CUSTOM, false)
g_map_le_unsprayedmargins_chance
CfgInt g_map_le_unsprayedmargins_chance("MAP_LE_UMARGIN_CHANCE", CFG_CUSTOM, 25)
g_farm_enable_crop_rotation
CfgBool g_farm_enable_crop_rotation("FARM_ENABLE_CROP_ROTATION", CFG_CUSTOM, true)
CFG_PUBLIC
Definition: configurator.h:61
g_farm_test_crop_daystorun
CfgInt g_farm_test_crop_daystorun("FARM_TEST_CROP_DAYSTORUN", CFG_CUSTOM, 36500)
CfgBool
Bool configurator entry class.
Definition: configurator.h:127
g_farm_test_crop_filename
CfgStr g_farm_test_crop_filename("FARM_TEST_CROP_FILENAME", CFG_CUSTOM, "OWinterRape_plant_1.txt")
g_farm_test_crop_farmtype
CfgInt g_farm_test_crop_farmtype("FARM_TEST_CROP_FARMTYPE", CFG_CUSTOM, 5)
g_farm_fixed_rotation_enable
CfgBool g_farm_fixed_rotation_enable("FARM_FIXED_ROTATION_ENABLE", CFG_CUSTOM, false)
g_farm_test_crop_sample_x
CfgInt g_farm_test_crop_sample_x("FARM_TEST_CROP_SAMPLE_X", CFG_CUSTOM, 1328)
CFG_CUSTOM
Definition: configurator.h:60
g_map_le_borderstype
CfgInt g_map_le_borderstype("MAP_LE_BORDERSTYPE", CFG_CUSTOM, 160)
g_farm_fixed_crop_type
CfgInt g_farm_fixed_crop_type("FARM_FIXED_CROP_TYPE", CFG_CUSTOM, 22)
g_map_le_border_chance
CfgInt g_map_le_border_chance("MAP_LE_BORDER_CHANCE", CFG_CUSTOM, 25)
CfgInt
Integer configurator entry class.
Definition: configurator.h:87
g_map_le_unsprayedmargins
CfgBool g_map_le_unsprayedmargins("MAP_LE_UNSPRAYEDMARGINS", CFG_CUSTOM, false)
configurator.h
g_map_orchards_borders
CfgBool g_map_orchards_borders("MAP_ORCHARDS_BORDERS", CFG_CUSTOM, false)
g_farm_fixed_crop_enable
CfgBool g_farm_fixed_crop_enable("FARM_FIXED_CROP_ENABLE", CFG_CUSTOM, false)
tov_declaration.h
g_farm_fixed_rotation_farmtype
CfgInt g_farm_fixed_rotation_farmtype("FARM_FIXED_ROTATION_FARMTYPE", CFG_CUSTOM, 0)
g_map_le_borderremoval
CfgBool g_map_le_borderremoval("MAP_LE_BORDERREMOVAL", CFG_CUSTOM, false)
g_farm_test_crop_sample_y
CfgInt g_farm_test_crop_sample_y("FARM_TEST_CROP_SAMPLE_Y", CFG_CUSTOM, 1328)