40 #define UNREFERENCED_PARAMETER(P) (P)
56 #define DO_IT_PROB (l_farm_event_do_it_prob.value())
57 #define DO_IT_PROB_LONG (l_farm_event_do_it_prob_long.value())
140 if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
147 a_field->InsectMortality( 0.1 );
151 int pref=a_field->GetUnsprayedMarginPolyRef();
156 um->InsectMortality( 0.1 );
171 if ((0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
174 a_field->InsectMortality(0.1);
176 int pref = a_field->GetUnsprayedMarginPolyRef();
181 um->InsectMortality(0.1);
195 if ((0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
198 a_field->InsectMortality(0.1);
200 int pref = a_field->GetUnsprayedMarginPolyRef();
205 um->InsectMortality(0.1);
219 if ((0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
222 a_field->InsectMortality(0.1);
224 int pref = a_field->GetUnsprayedMarginPolyRef();
229 um->InsectMortality(0.1);
246 int pref = a_field->GetUnsprayedMarginPolyRef();
264 if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
268 a_field->InsectMortality( 0.1 );
271 int pref=a_field->GetUnsprayedMarginPolyRef();
276 um->InsectMortality( 0.1 );
291 if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
295 int pref=a_field->GetUnsprayedMarginPolyRef();
313 if ((0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
317 a_field->InsectMortality(0.1);
320 int pref = a_field->GetUnsprayedMarginPolyRef();
325 um->InsectMortality(0.1);
339 if ((0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
342 a_field->SetGrowthPhase(sow);
343 a_field->SetLastSownVeg(a_field->GetVegType());
346 int pref = a_field->GetUnsprayedMarginPolyRef();
351 um->SetGrowthPhase(sow);
353 um->SetLastSownVeg(um->GetVegType());
367 if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
370 a_field->SetGrowthPhase( sow );
371 a_field->SetLastSownVeg(a_field->GetVegType());
374 int pref=a_field->GetUnsprayedMarginPolyRef();
379 um->SetGrowthPhase( sow );
381 um->SetLastSownVeg(um->GetVegType());
395 if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
398 a_field->InsectMortality( 0.1 );
400 int pref=a_field->GetUnsprayedMarginPolyRef();
405 um->InsectMortality( 0.1 );
420 if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
424 a_field->InsectMortality( 0.1 );
427 int pref=a_field->GetUnsprayedMarginPolyRef();
432 um->InsectMortality( 0.1 );
447 if ((a_days <= 0) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
451 a_field->InsectMortality( 0.1 );
454 int pref=a_field->GetUnsprayedMarginPolyRef();
459 um->InsectMortality( 0.1);
474 if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
478 a_field->InsectMortality( 0.7 );
481 int pref=a_field->GetUnsprayedMarginPolyRef();
486 um->InsectMortality( 0.7 );
501 if ((0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
505 a_field->InsectMortality(0.7);
507 a_field->ReduceVeg(0.8);
508 int pref = a_field->GetUnsprayedMarginPolyRef();
513 um->InsectMortality(0.7);
528 if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
531 int pref=a_field->GetUnsprayedMarginPolyRef();
549 if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
552 a_field->SetGrowthPhase( sow );
553 a_field->SetLastSownVeg(a_field->GetVegType());
556 int pref=a_field->GetUnsprayedMarginPolyRef();
561 um->SetGrowthPhase( sow );
563 um->SetLastSownVeg(um->GetVegType());
577 if ((0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
580 a_field->SetGrowthPhase(sow);
581 a_field->SetLastSownVeg(a_field->GetVegType());
584 int pref = a_field->GetUnsprayedMarginPolyRef();
589 um->SetGrowthPhase(sow);
591 um->SetLastSownVeg(um->GetVegType());
605 if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
607 a_field->SetLastTreatment(
fp_npks );
608 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
609 int pref=a_field->GetUnsprayedMarginPolyRef();
614 um->SetGrowthPhase( harvest1 );
615 um->InsectMortality( 0.4 );
616 um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
632 if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
634 a_field->SetLastTreatment(
fp_npk );
635 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
636 int pref=a_field->GetUnsprayedMarginPolyRef();
640 um->SetLastTreatment(
fp_npk);
641 um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
656 if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
657 a_field->Trace(
fp_pk );
658 a_field->SetLastTreatment(
fp_pk );
659 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
660 int pref=a_field->GetUnsprayedMarginPolyRef();
664 um->SetLastTreatment(
fp_pk);
665 um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
680 if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
683 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
684 int pref=a_field->GetUnsprayedMarginPolyRef();
689 um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
704 if ( (0 >= a_days) || ((g_weather->GetTemp()>0)&&
709 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
710 int pref=a_field->GetUnsprayedMarginPolyRef();
715 um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
730 if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
733 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
734 int pref=a_field->GetUnsprayedMarginPolyRef();
739 um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
753 if ((0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
756 a_field->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
757 int pref = a_field->GetUnsprayedMarginPolyRef();
762 um->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
776 if ( (0 >= a_days) || ((g_weather->GetTemp()>0)&&
780 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
781 int pref=a_field->GetUnsprayedMarginPolyRef();
786 um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
801 if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
804 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
805 int pref=a_field->GetUnsprayedMarginPolyRef();
810 um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
825 if ( (0 >= a_days) || ((g_weather->GetTemp()>0)&&
830 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
831 int pref=a_field->GetUnsprayedMarginPolyRef();
836 um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
849 if ((0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
851 a_field->SetLastTreatment(
fp_rsm);
852 a_field->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
853 int pref = a_field->GetUnsprayedMarginPolyRef();
857 um->SetLastTreatment(
fp_rsm);
858 um->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
871 if ((0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
874 a_field->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
875 int pref = a_field->GetUnsprayedMarginPolyRef();
880 um->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
894 if ((0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
896 a_field->SetLastTreatment(
fa_npks);
897 a_field->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
898 int pref = a_field->GetUnsprayedMarginPolyRef();
903 um->SetGrowthPhase(harvest1);
904 um->InsectMortality(0.4);
905 um->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
920 if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
922 a_field->SetLastTreatment(
fa_npk );
923 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
924 int pref=a_field->GetUnsprayedMarginPolyRef();
928 um->SetLastTreatment(
fa_npk );
929 um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
944 if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
945 a_field->Trace(
fa_pk );
946 a_field->SetLastTreatment(
fa_pk );
947 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
948 int pref=a_field->GetUnsprayedMarginPolyRef();
952 um->SetLastTreatment(
fa_pk );
953 um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
968 if ( (0 >= a_days) || ((g_weather->GetTemp()>0)&&
973 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
974 int pref=a_field->GetUnsprayedMarginPolyRef();
979 um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
993 if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
996 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
997 int pref=a_field->GetUnsprayedMarginPolyRef();
1002 um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1015 if ((0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
1018 a_field->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
1019 int pref = a_field->GetUnsprayedMarginPolyRef();
1024 um->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
1039 if ( (0 >= a_days) || ((g_weather->GetTemp()>0)&&
1044 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1045 int pref=a_field->GetUnsprayedMarginPolyRef();
1050 um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1065 if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
1068 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1069 int pref=a_field->GetUnsprayedMarginPolyRef();
1074 um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1089 if ( (0 >= a_days) || ((g_weather->GetTemp()>0)&&
1094 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1095 int pref=a_field->GetUnsprayedMarginPolyRef();
1100 um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1113 if ((0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
1115 a_field->SetLastTreatment(
fa_rsm);
1116 a_field->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
1117 int pref = a_field->GetUnsprayedMarginPolyRef();
1121 um->SetLastTreatment(
fa_rsm);
1122 um->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
1135 if ((0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
1138 a_field->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
1139 int pref = a_field->GetUnsprayedMarginPolyRef();
1144 um->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
1161 if (((a_field->GetSignal() & LE_SIG_NO_HERBICIDE)==0 ))
1167 a_field->ReduceWeedBiomass( 0.05 );
1169 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1170 a_field->SetHerbicideDelay( EL_HERBICIDE_DELAYTIME );
1176 else if ((g_weather->GetWind()<4.5) && (!g_weather->Raining()) && DoIt(
DO_IT_PROB))
1178 if ( !(a_field->GetSignal() & LE_SIG_NO_HERBICIDE) )
1184 a_field->ReduceWeedBiomass( 0.05 );
1186 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1187 a_field->SetHerbicideDelay( EL_HERBICIDE_DELAYTIME );
1201 if (((a_field->GetSignal() & LE_SIG_NO_HERBICIDE)==0 ))
1206 a_field->ReduceWeedBiomass( 0.05 );
1208 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1209 a_field->SetHerbicideDelay( EL_HERBICIDE_DELAYTIME );
1214 Field * pf = dynamic_cast<Field*>(a_field);
1215 pf->Add_no_herb_app();
1221 else if ((g_weather->GetWind()<4.5) && (!g_weather->Raining()) && DoIt(
DO_IT_PROB))
1223 if ( !(a_field->GetSignal() & LE_SIG_NO_HERBICIDE) )
1228 a_field->ReduceWeedBiomass( 0.05 );
1230 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1231 a_field->SetHerbicideDelay( EL_HERBICIDE_DELAYTIME );
1235 Field * pf = dynamic_cast<Field*>(a_field);
1236 pf->Add_no_herb_app();
1255 if ( (!g_weather->Raining()) && (g_weather->GetWind()<4.5) &&
1256 (!(a_field->GetSignal() & LE_SIG_NO_GROWTH_REG) )) {
1259 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1263 else if ( (g_weather->GetWind()<4.5) &&
1264 (!g_weather->Raining()) && DoIt(
DO_IT_PROB)) {
1265 if ( ! (a_field->GetSignal() & LE_SIG_NO_GROWTH_REG) ) {
1268 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1284 if ( ( ! a_field->GetSignal() & LE_SIG_NO_FUNGICIDE ))
1288 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1293 else if ( (g_weather->GetWind()<4.5) &&
1294 (!g_weather->Raining()) && DoIt(
DO_IT_PROB)) {
1295 if ( ! (a_field->GetSignal() & LE_SIG_NO_FUNGICIDE) ) {
1298 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1312 if ( ( ! a_field->GetSignal() & LE_SIG_NO_FUNGICIDE )) {
1315 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1319 Field * pf = dynamic_cast<Field*>(a_field);
1320 pf->Add_no_fi_app();
1325 else if ( (g_weather->GetWind()<4.5) && (!g_weather->Raining()) && DoIt(
DO_IT_PROB)) {
1326 if ( ! (a_field->GetSignal() & LE_SIG_NO_FUNGICIDE) ) {
1329 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1333 Field * pf = dynamic_cast<Field*>(a_field);
1334 pf->Add_no_fi_app();
1353 if (( ! (a_field->GetSignal() & LE_SIG_NO_INSECTICIDE) ))
1362 a_field->Insecticide( 0.36 );
1364 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1369 else if ( (g_weather->GetWind()<4.5) &&
1370 (!g_weather->Raining()) && DoIt(
DO_IT_PROB)) {
1371 if ( ! (a_field->GetSignal() & LE_SIG_NO_INSECTICIDE )) {
1378 a_field->Insecticide( 0.36 );
1380 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1394 if (( ! (a_field->GetSignal() & LE_SIG_NO_INSECTICIDE) ))
1402 a_field->Insecticide( 0.36 );
1404 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1408 Field * pf = dynamic_cast<Field*>(a_field);
1409 pf->Add_no_fi_app();
1415 else if ( (g_weather->GetWind()<4.5) && (!g_weather->Raining()) && DoIt(
DO_IT_PROB))
1417 if ( ! (a_field->GetSignal() & LE_SIG_NO_INSECTICIDE )) {
1424 a_field->Insecticide( 0.36 );
1426 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1430 Field * pf = dynamic_cast<Field*>(a_field);
1431 pf->Add_no_fi_app();
1456 a_field->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
1458 g_pest->DailyQueueAdd(a_field, a_applicationrate, a_ppp);
1462 if ((!g_weather->Raining()) && (g_weather->GetWind() < 4.5)) {
1468 a_field->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
1470 g_pest->DailyQueueAdd(a_field, a_applicationrate, a_ppp);
1485 if ( (!g_weather->Raining()) && (g_weather->GetWind()<4.5) &&
1486 (! (a_field->GetSignal() & LE_SIG_NO_MOLLUSC ))) {
1489 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1494 else if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
1495 if ( ! (a_field->GetSignal() & LE_SIG_NO_MOLLUSC) ) {
1498 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1513 if ( (0 >= a_days) && (g_weather->GetRainPeriod(g_date->Date(),3)<0.1) )
1519 if ( (0 >= a_days) ||
1520 ((g_weather->GetRainPeriod(g_date->Date(),3)<0.1) && DoIt(
DO_IT_PROB))
1524 a_field->ReduceWeedBiomass( 0.5 );
1525 a_field->InsectMortality( 0.25 );
1526 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1527 int pref=a_field->GetUnsprayedMarginPolyRef();
1532 um->InsectMortality( 0.25 );
1533 um->ReduceWeedBiomass( 0.5 );
1534 um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1549 if ( (0 >= a_days) )
1553 a_field->ReduceWeedBiomass( 0.05 );
1554 a_field->InsectMortality( 0.7 );
1555 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1556 a_field->SetHerbicideDelay( EL_STRIGLING_DELAYTIME );
1557 int pref=a_field->GetUnsprayedMarginPolyRef();
1562 um->ReduceWeedBiomass( 0.05 );
1563 um->InsectMortality( 0.7 );
1564 um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1565 um->SetHerbicideDelay( EL_STRIGLING_DELAYTIME );
1569 if ( (0 >= a_days) ||
1570 ((g_weather->GetRainPeriod(g_date->Date(),3)<0.1) && DoIt(
DO_IT_PROB))
1574 a_field->ReduceWeedBiomass( 0.05 );
1575 a_field->InsectMortality( 0.7 );
1576 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1577 a_field->SetHerbicideDelay( EL_STRIGLING_DELAYTIME );
1578 int pref=a_field->GetUnsprayedMarginPolyRef();
1583 um->ReduceWeedBiomass( 0.05 );
1584 um->InsectMortality( 0.7 );
1585 um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1586 um->SetHerbicideDelay( EL_STRIGLING_DELAYTIME );
1601 if ( (0 >= a_days) && (g_weather->GetRainPeriod(g_date->Date(),3)<0.1) )
1606 if ( (0 >= a_days) ||
1607 ((g_weather->GetRainPeriod(g_date->Date(),3)<0.1) && DoIt(
DO_IT_PROB))
1611 a_field->ReduceWeedBiomass( 0.05 );
1612 a_field->InsectMortality( 0.7 );
1613 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1614 a_field->SetHerbicideDelay( EL_STRIGLING_DELAYTIME );
1615 int pref=a_field->GetUnsprayedMarginPolyRef();
1620 um->ReduceWeedBiomass( 0.05 );
1621 um->InsectMortality( 0.7 );
1622 um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1623 um->SetHerbicideDelay( EL_STRIGLING_DELAYTIME );
1638 if ((0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
1641 a_field->InsectMortality(0.75);
1642 a_field->ReduceWeedBiomass(0.25);
1643 a_field->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
1644 int pref = a_field->GetUnsprayedMarginPolyRef();
1649 um->ReduceWeedBiomass(0.25);
1650 um->InsectMortality(0.75);
1651 um->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
1666 if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
1669 a_field->InsectMortality( 0.75 );
1670 a_field->ReduceWeedBiomass( 0.25 );
1671 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1672 int pref=a_field->GetUnsprayedMarginPolyRef();
1677 um->ReduceWeedBiomass( 0.25 );
1678 um->InsectMortality( 0.75 );
1679 um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1693 if ((0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
1696 a_field->InsectMortality(0.75);
1698 a_field->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
1699 int pref = a_field->GetUnsprayedMarginPolyRef();
1705 um->InsectMortality(0.75);
1706 um->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
1726 if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
1727 a_field->Trace(
water );
1728 a_field->SetLastTreatment(
water );
1729 int pref=a_field->GetUnsprayedMarginPolyRef();
1733 um->SetLastTreatment(
water );
1747 if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
1749 a_field->SetLastTreatment(
swathing );
1750 a_field->InsectMortality( 0.5 );
1751 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1752 int pref=a_field->GetUnsprayedMarginPolyRef();
1757 um->InsectMortality( 0.5 );
1758 um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1772 if ((0 >= a_days) || ((g_weather->GetRainPeriod(g_date->Date(), 5) < 0.1) && DoIt(
DO_IT_PROB))) {
1774 a_field->SetLastTreatment(
harvest);
1775 a_field->SetGrowthPhase(harvest1);
1777 a_field->InsectMortality(0.4);
1778 double insects = a_field->GetInsectPop();
1779 a_field->ResetDigestability();
1780 a_field->RecalculateBugsNStuff();
1781 a_field->SetInsectPop(insects);
1782 a_field->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
1783 int pref = a_field->GetUnsprayedMarginPolyRef();
1785 double someseed = 0.0;
1786 double somemaize = 0.0;
1787 if (dynamic_cast<VegElement*>(a_field)->IsMatureCereal()) {
1788 someseed = m_OurManager->GetSpilledGrain();
1789 a_field->SetStubble(
true);
1791 else if (dynamic_cast<VegElement*>(a_field)->IsMaize()) {
1793 a_field->SetStubble(
true);
1794 somemaize = m_OurManager->GetSpilledMaize();
1796 a_field->SetBirdSeed( someseed );
1797 a_field->SetBirdMaize( somemaize );
1801 um->SetLastTreatment(
harvest);
1802 um->SetGrowthPhase(harvest1);
1803 um->InsectMortality(0.4);
1804 um->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
1805 um->ResetDigestability();
1806 um->RecalculateBugsNStuff();
1807 um->SetBirdSeed( someseed );
1808 um->SetBirdMaize( somemaize );
1809 if ((somemaize > 0) || (someseed > 0)) um->SetStubble(
true);
1825 if ((0 >= a_days) ||
1826 ((g_weather->GetRainPeriod(g_date->Date(), 5)<0.1) && DoIt(
DO_IT_PROB_LONG))
1829 a_field->SetLastTreatment(
harvest);
1830 a_field->SetGrowthPhase(harvest1);
1832 a_field->InsectMortality(0.4);
1833 double insects = a_field->GetInsectPop();
1834 a_field->ResetDigestability();
1835 a_field->RecalculateBugsNStuff();
1836 a_field->SetInsectPop(insects);
1837 a_field->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
1838 int pref = a_field->GetUnsprayedMarginPolyRef();
1839 double someseed = 0.0;
1840 a_field->SetBirdSeed( someseed );
1841 a_field->SetBirdMaize( someseed );
1845 um->SetLastTreatment(
harvest);
1846 um->SetGrowthPhase(harvest1);
1847 um->InsectMortality(0.4);
1848 um->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
1849 um->ResetDigestability();
1850 um->RecalculateBugsNStuff();
1851 um->SetBirdSeed( someseed );
1852 um->SetBirdMaize( someseed );
1863 if ( (0 >= a_days) ||
1864 ((g_weather->GetRainPeriod(g_date->Date(),5)<0.1) && DoIt(
DO_IT_PROB)))
1869 Field * pf = dynamic_cast<Field*>(a_field);
1871 double biomass_at_harvest = a_field->GetVegBiomass();
1872 pf->Set_biomass_at_harvest(biomass_at_harvest, 0);
1873 pf->Set_harvested();
1879 a_field->SetLastTreatment(
harvest );
1880 a_field->SetGrowthPhase( harvest1 );
1882 a_field->InsectMortality( 0.4 );
1883 double insects=a_field->GetInsectPop();
1884 a_field->RecalculateBugsNStuff();
1885 a_field->SetInsectPop(insects);
1886 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1887 a_field->ResetDigestability();
1888 int pref=a_field->GetUnsprayedMarginPolyRef();
1892 um->SetLastTreatment(
harvest);
1893 um->SetGrowthPhase( harvest1 );
1894 um->InsectMortality( 0.4 );
1895 um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1896 um->ResetDigestability();
1897 um->RecalculateBugsNStuff();
1917 a_field->ToggleCattleGrazing();
1925 int pref = a_field->GetUnsprayedMarginPolyRef();
1931 um->ToggleCattleGrazing();
1948 a_field->ToggleCattleGrazing();
1956 int pref=a_field->GetUnsprayedMarginPolyRef();
1961 um->ToggleCattleGrazing();
1979 double biomass = a_field->GetVegBiomass();
1980 if (biomass > 100.0)
1989 int pref = a_field->GetUnsprayedMarginPolyRef();
1998 int d1 = g_date->DayInYear(10, 9);
1999 if (d1 > a_max) d1 = a_max;
2000 if ((((g_date->DayInYear() > d1) && (10 >= a_days)) && DoIt(10)) || (0 >= a_days))
2002 a_field->ToggleCattleGrazing();
2003 int pref = a_field->GetUnsprayedMarginPolyRef();
2007 um->ToggleCattleGrazing();
2023 double biomass = a_field->GetVegBiomass();
2024 if (biomass > 100.0)
2033 int pref = a_field->GetUnsprayedMarginPolyRef();
2042 int d1 = g_date->DayInYear(10, 9);
2043 if (d1 > a_max) d1 = a_max;
2044 if ((((g_date->DayInYear() > d1) && (10 >= a_days)) && DoIt(10)) || (0 >= a_days))
2046 a_field->ToggleCattleGrazing();
2047 int pref = a_field->GetUnsprayedMarginPolyRef();
2051 um->ToggleCattleGrazing();
2067 a_field->TogglePigGrazing();
2069 a_field->SetLastTreatment(
pigs_out );
2074 int pref=a_field->GetUnsprayedMarginPolyRef();
2092 a_field->SetLastTreatment(
pigs_out );
2098 int pref=a_field->GetUnsprayedMarginPolyRef();
2115 if ( (0 >= a_days)|| DoIt(50/a_days)) {
2116 a_field->TogglePigGrazing();
2117 int pref=a_field->GetUnsprayedMarginPolyRef();
2121 um->TogglePigGrazing();
2135 if ( (0 >= a_days) ||
2136 ((g_weather->GetRainPeriod(g_date->Date(),5)<0.1) && DoIt(
DO_IT_PROB))
2140 a_field->InsectMortality( 0.4 );
2141 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
2142 int pref=a_field->GetUnsprayedMarginPolyRef();
2147 um->InsectMortality( 0.4 );
2148 um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
2162 if ( (0 >= a_days) ||
2163 ((g_weather->GetRainPeriod(g_date->Date(),5)<0.1) && DoIt(
DO_IT_PROB))
2167 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
2168 int pref=a_field->GetUnsprayedMarginPolyRef();
2173 um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
2187 if ( (0 >= a_days) ||
2188 ((g_weather->GetRainPeriod(g_date->Date(),5)<0.1) && DoIt(
DO_IT_PROB))
2192 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
2193 int pref=a_field->GetUnsprayedMarginPolyRef();
2198 um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
2212 if ( (0 >= a_days) ||
2213 ((g_weather->GetRainPeriod(g_date->Date(),3)<0.1) && DoIt(
DO_IT_PROB))
2217 a_field->InsectMortality( 0.25 );
2219 int pref=a_field->GetUnsprayedMarginPolyRef();
2225 um->InsectMortality( 0.25 );
2239 if ( (0 >= a_days) && (g_weather->GetRainPeriod(g_date->Date(),3)>0.1))
2243 if ( (0 >= a_days) || ((g_weather->GetRainPeriod(g_date->Date(),3)<0.1)
2248 a_field->InsectMortality( 0.4 );
2249 a_field->ReduceVeg( 0.2 );
2250 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
2251 int pref=a_field->GetUnsprayedMarginPolyRef();
2256 um->ReduceVeg( 0.2 );
2257 um->InsectMortality( 0.4 );
2258 um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
2272 if ( (0 >= a_days) || ((g_weather->GetRainPeriod(g_date->Date(),5)<0.1)
2277 a_field->SetGrowthPhase(harvest1);
2278 a_field->InsectMortality(0.4);
2279 a_field->ReduceVeg_Extended( 0.2 );
2280 a_field->SetVegHeight(10);
2282 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
2283 int pref=a_field->GetUnsprayedMarginPolyRef();
2288 um->SetGrowthPhase(harvest1);
2289 um->InsectMortality(0.4);
2290 um->ReduceVeg_Extended( 0.2 );
2291 um->SetVegHeight( 10);
2292 um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
2306 if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB)))
2310 a_field->ReduceVeg( 0.8 );
2311 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
2312 int pref=a_field->GetUnsprayedMarginPolyRef();
2317 um->ReduceVeg( 0.8 );
2318 um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
2332 if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
2335 a_field->ReduceVeg_Extended( 0.2 );
2336 a_field->InsectMortality( 0.4 );
2337 a_field->SetVegHeight( 10 );
2338 a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
2339 a_field->SetGrowthPhase(harvest1);
2341 int pref=a_field->GetUnsprayedMarginPolyRef();
2346 um->ReduceVeg_Extended( 0.2 );
2347 um->InsectMortality( 0.4 );
2348 um->SetVegHeight( 10 );
2349 um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
2350 um->ResetDigestability();
2351 um->SetGrowthPhase(harvest1);
2365 if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
2366 a_field->Trace(
mow );
2367 a_field->SetLastTreatment(
mow );
2368 a_field->SetMownDecay( 12 );
2371 a_field->SetGrowthPhase( harvest1 );
2376 int pref=a_field->GetUnsprayedMarginPolyRef();
2380 um->SetLastTreatment(
mow );
2381 um->ReduceVeg_Extended( 0.2 );
2382 um->InsectMortality( 0.4 );
2405 a_field->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
2406 a_field->SetSprayedToday(
true);
2407 g_pest->DailyQueueAdd(a_field, a_applicationrate, a_ppp);
2417 if ((0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
2419 a_field->SetLastTreatment(
biocide);
2420 a_field->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
2421 int pref = a_field->GetUnsprayedMarginPolyRef();
2425 um->SetLastTreatment(
biocide);
2426 um->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
2439 if ((0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
2441 a_field->ReduceVeg_Extended(0.8);
2442 a_field->InsectMortality(0.9);
2443 a_field->SetVegHeight(35);
2445 a_field->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
2446 int pref = a_field->GetUnsprayedMarginPolyRef();
2450 um->ReduceVeg_Extended(0.8);
2451 um->InsectMortality(0.9);
2452 um->SetVegHeight(30);
2454 um->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
2468 if ((0 >= a_days) || ((g_weather->GetRainPeriod(g_date->Date(), 5) < 0.1) && DoIt(
DO_IT_PROB))) {
2471 a_field->SetGrowthPhase(harvest1);
2473 a_field->InsectMortality(0.3);
2476 double insects = a_field->GetInsectPop();
2477 a_field->ResetDigestability();
2478 a_field->RecalculateBugsNStuff();
2479 a_field->SetInsectPop(insects);
2480 a_field->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
2481 int pref = a_field->GetUnsprayedMarginPolyRef();
2486 um->SetGrowthPhase(harvest1);
2487 um->InsectMortality(0.3);
2489 um->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
2490 um->ResetDigestability();
2491 um->RecalculateBugsNStuff();
2504 if ((0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
2507 a_field->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
2508 int pref = a_field->GetUnsprayedMarginPolyRef();
2513 um->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
2526 if ((0 >= a_days) || (!g_weather->Raining() && DoIt(
DO_IT_PROB))) {
2529 a_field->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
2530 int pref = a_field->GetUnsprayedMarginPolyRef();
2535 um->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);