49 #include "../Landscape/ls.h"
50 #include "../BatchALMaSS/PopulationManager.h"
51 #include "../GooseManagement/GooseMemoryMap.h"
52 #include "../GooseManagement/Goose_Base.h"
53 #include "../BatchALMaSS/CurveClasses.h"
54 #include "../Hunters/Hunters_all.h"
55 #include "../GooseManagement/Goose_Population_Manager.h"
56 #ifdef __ALMASS_VISUAL
58 #include "wx/spinctrl.h"
59 #include "../GUI/ALMaSS_GUI.h"
61 #include "../BatchALMaSS/BoostRandomGenerators.h"
62 #include "AOR_Probe.h"
64 extern boost::variate_generator<base_generator_type&, boost::uniform_real<> >
g_rand_uni;
99 #define _CRTDBG_MAP_ALLOC
136 if ( m_MyFile != NULL ) {
137 if (m_MyFile->is_open()) m_MyFile->close();
226 TheArray.insert( TheArray.end(), 12, alist );
229 SimW = m_TheLandscape->SupplySimAreaWidth();
230 SimHH = m_TheLandscape->SupplySimAreaHeight()/2;
231 SimWH = m_TheLandscape->SupplySimAreaWidth()/2;
235 for (
int i = 0; i < 12; i++) {
237 BeforeStepActions[ i ] = 0;
238 m_ListNames[ i ] =
"Unknown";
239 m_LiveArraySize.push_back( 0 );
242 StateNamesLength = 0;
243 m_catastrophestartyear=-1;
244 #ifdef __LAMBDA_RECORD
245 ofstream fout(
"LambdaGridOuput.txt", ios_base::out);
250 OpenTheMonthlyRipleysOutputProbe();
253 OpenTheAOROutputProbe(
"AOR_Probe.txt");
256 #ifdef __ALMASS_VISUAL
268 for (
unsigned i = 0; i < TheArray.size(); i++ ) {
270 for (
unsigned j = 0; j < (unsigned) GetLiveArraySize(i); j++ ) {
271 delete TheArray[ i ] [ j ];
274 TheArray[ i ].clear();
278 CloseTheRipleysOutputProbe();
281 CloseTheMonthlyRipleysOutputProbe();
284 CloseTheReallyBigOutputProbe();
295 FILE * PFile = fopen(fname,
"w" );
297 m_TheLandscape->Warn(
"PopulationManager::LOG - Could not open file ",fname);
301 for (
unsigned listindex = 0; listindex < TheArray.size(); listindex++ ) {
303 fprintf( PFile,
"%s :\n", m_ListNames[ listindex ] );
305 fprintf( PFile,
"%s :\n", m_ListNames[ listindex ].c_str() );
307 for (
unsigned j = 0; j < (unsigned) m_LiveArraySize[listindex]; j++ ) {
308 AP = TheArray[ listindex ] [ j ]->SupplyPosition();
309 fprintf( PFile,
"%i %i %i\n", j, AP.
m_x, AP.
m_y );
341 for (
int TSteps = 0; TSteps < NoTSteps; TSteps++ )
344 unsigned size1 = (unsigned) TheArray.size();
349 for (
unsigned listindex = 0; listindex < size1; listindex++ )
352 m_LiveArraySize[listindex] = PartitionLiveDead(listindex);
354 #ifdef __ALMASS_VISUAL
355 if (m_MainForm!=NULL)
358 for (
unsigned listindex = 0; listindex < size1; listindex++ ) n += (
int) m_LiveArraySize[ listindex ];
365 for (
unsigned listindex = 0; listindex < size1; listindex++ )
367 size2 = (unsigned) GetLiveArraySize(listindex);
368 for (
unsigned j = 0; j < size2; j++ )
370 TheArray[ listindex ] [ j ]->SetStepDone(
false );
374 for (
unsigned listindex = 0; listindex < size1; listindex++ ) {
376 Shuffle_or_Sort( listindex );
380 int Year = m_TheLandscape->SupplyYearNumber();
383 int day = m_TheLandscape->SupplyDayInYear();
386 TheRipleysOutputProbe(RipleysOutputPrb);
393 int Year = m_TheLandscape->SupplyYearNumber();
396 int day = m_TheLandscape->SupplyDayInYear();
406 if (m_TheLandscape->SupplyDayInMonth()==1) {
407 int Year = m_TheLandscape->SupplyYearNumber();
410 int month = m_TheLandscape->SupplyMonth();
413 case 1: TheRipleysOutputProbe( RipleysOutputPrb1 );
415 case 2: TheRipleysOutputProbe( RipleysOutputPrb2 );
417 case 3: TheRipleysOutputProbe( RipleysOutputPrb3 );
419 case 4: TheRipleysOutputProbe( RipleysOutputPrb4 );
421 case 5: TheRipleysOutputProbe( RipleysOutputPrb5 );
423 case 6: TheRipleysOutputProbe( RipleysOutputPrb6 );
425 case 7: TheRipleysOutputProbe( RipleysOutputPrb7 );
427 case 8: TheRipleysOutputProbe( RipleysOutputPrb8 );
429 case 9: TheRipleysOutputProbe( RipleysOutputPrb9 );
431 case 10: TheRipleysOutputProbe( RipleysOutputPrb10 );
433 case 11: TheRipleysOutputProbe( RipleysOutputPrb11 );
435 case 12: TheRipleysOutputProbe( RipleysOutputPrb12 );
444 int Year = m_TheLandscape->SupplyYearNumber();
447 int day = m_TheLandscape->SupplyDayInYear();
451 TheReallyBigOutputProbe();
456 int yr=m_TheLandscape->SupplyYearNumber();
458 if (m_catastrophestartyear==-1) m_catastrophestartyear=yr;
463 for (
unsigned listindex = 0; listindex < size1; listindex++ ) {
464 size2 = (unsigned)GetLiveArraySize( listindex );
465 for (
unsigned j = 0; j < size2; j++)
466 TheArray[ listindex ] [ j ]->BeginStep();
471 for (
unsigned listindex = 0; listindex < size1; listindex++ ) {
472 size2 = (unsigned)GetLiveArraySize( listindex );
473 for (
unsigned j = 0; j < size2; j++) {
474 TheArray[ listindex ] [ j ]->Step();
477 }
while ( !StepFinished() );
480 for (
unsigned listindex = 0; listindex < size1; listindex++ ) {
481 size2 = (unsigned)GetLiveArraySize( listindex );
482 for (
unsigned j = 0; j < size2; j++) {
483 TheArray[ listindex ] [ j ]->EndStep();
499 for (
unsigned listindex = 0; listindex < TheArray.size(); listindex++ ) {
500 for (
unsigned j = 0; j < (unsigned)GetLiveArraySize( listindex ); j++) {
501 if ( TheArray[ listindex ] [ j ]->GetStepDone() == false ) {
565 #ifdef __ALMASS_VISUAL
566 m_MainForm->UpdateGraphics();
579 PFile = fopen(p_Filename,
"r" );
581 m_TheLandscape->Warn(
"Population Manager - cannot open Probe File ", p_Filename );
584 fgets( S, 255, PFile );
585 fgets( S, 255, PFile );
586 fscanf( PFile,
"%d\n", & data );
587 TheProbe[ p_ProbeNo ]->m_ReportInterval = data;
588 fgets( S, 255, PFile );
589 fscanf( PFile,
"%d\n", & data );
590 if ( data == 0 ) TheProbe[ p_ProbeNo ]->m_FileRecord =
false;
else
591 TheProbe[ p_ProbeNo ]->m_FileRecord =
true;
592 fgets( S, 255, PFile );
593 for (
int i = 0; i < 10; i++ ) {
594 fscanf( PFile,
"%d", & data );
595 if ( data > 0 ) TheProbe[ p_ProbeNo ]->m_TargetTypes[ i ] =
true;
else
596 TheProbe[ p_ProbeNo ]->m_TargetTypes[ i ] =
false;
599 fgets( S, 255, PFile );
600 fgets( S, 255, PFile );
601 fscanf( PFile,
"%d", & data );
602 TheProbe[ p_ProbeNo ]->m_NoAreas = data;
603 fgets( S, 255, PFile );
604 fgets( S, 255, PFile );
605 fscanf( PFile,
"%d", & data2 );
606 fgets( S, 255, PFile );
607 fgets( S, 255, PFile );
608 fscanf( PFile,
"%d", & data );
609 if ( data == 1 ) TheProbe[ p_ProbeNo ]->m_NoEleTypes = data2;
else
610 TheProbe[ p_ProbeNo ]->m_NoEleTypes = 0;
611 if ( data == 2 ) TheProbe[ p_ProbeNo ]->m_NoVegTypes = data2;
else
612 TheProbe[ p_ProbeNo ]->m_NoVegTypes = 0;
613 if ( data == 3 ) TheProbe[ p_ProbeNo ]->m_NoFarms = data2;
else
614 TheProbe[ p_ProbeNo ]->m_NoFarms = 0;
615 fgets( S, 255, PFile );
616 fgets( S, 255, PFile );
618 for (
int i = 0; i < 10; i++ ) {
619 fscanf( PFile,
"%d", & data );
620 TheProbe[ p_ProbeNo ]->m_Rect[ i ].m_x1 = data;
621 fscanf( PFile,
"%d", & data );
622 TheProbe[ p_ProbeNo ]->m_Rect[ i ].m_y1 = data;
623 fscanf( PFile,
"%d", & data );
624 TheProbe[ p_ProbeNo ]->m_Rect[ i ].m_x2 = data;
625 fscanf( PFile,
"%d", & data );
626 TheProbe[ p_ProbeNo ]->m_Rect[ i ].m_y2 = data;
628 fgets( S, 255, PFile );
629 fgets( S, 255, PFile );
630 if ( TheProbe[ p_ProbeNo ]->m_NoVegTypes > 0 ) {
631 for (
int i = 0; i < 25; i++ ) {
632 fscanf( PFile,
"%d", & data );
634 TheProbe[ p_ProbeNo ]->m_RefVeg[ i ] = m_TheLandscape->TranslateVegTypes( data );
636 }
else if ( TheProbe[ p_ProbeNo ]->m_NoFarms > 0 ) {
637 for (
int i = 0; i < 25; i++ ) {
638 fscanf( PFile,
"%d", & data );
640 TheProbe[ p_ProbeNo ]->m_RefFarms[ i ] = data;
643 for (
int i = 0; i < 25; i++ ) {
644 fscanf( PFile,
"%d", & data );
645 if ( data != 999 ) TheProbe[ p_ProbeNo ]->m_RefEle[ i ] = m_TheLandscape->TranslateEleTypes( data );
658 ofstream fout(
"LambdaGridOuput.txt", ios_base::app);
659 for (
int i=0; i<257; i++ ) {
660 for (
int j=0; j<257; j++) {
661 fout << lamdagrid[0][i][j] <<
"\t" << lamdagrid[1][i][j] << endl;
688 for (
unsigned j = 0; j < (unsigned)GetLiveArraySize( ListIndex ); j++) {
689 Sp = TheArray[ ListIndex ] [ j ]->SupplyPosition();
690 unsigned Farm = TheArray[ ListIndex ] [ j ]->SupplyFarmOwnerRef();
691 for (
unsigned i = 0; i < p_TheProbe->
m_NoAreas; i++ ) {
694 for (
unsigned k = 0; k < p_TheProbe->
m_NoFarms; k++ ) {
702 for (
unsigned j = 0; j < (unsigned)GetLiveArraySize( ListIndex ); j++) {
703 Sp = TheArray[ ListIndex ] [ j ]->SupplyPosition();
704 for (
unsigned i = 0; i < p_TheProbe->
m_NoAreas; i++ ) {
707 for (
unsigned k = 0; k < p_TheProbe->
m_NoEleTypes; k++ ) {
715 for (
unsigned j = 0; j < (unsigned)GetLiveArraySize( ListIndex ); j++) {
716 Sp = TheArray[ ListIndex ] [ j ]->SupplyPosition();
718 for (
unsigned i = 0; i < p_TheProbe->
m_NoAreas; i++ ) {
721 for (
unsigned k = 0; k < p_TheProbe->
m_NoVegTypes; k++ ) {
730 unsigned sz = (unsigned)GetLiveArraySize( ListIndex );
735 (p_TheProbe->
m_Rect[0].
m_y2==(
unsigned)SimH)) {
740 for (
unsigned j = 0; j < sz; j++ ) {
741 Sp = TheArray[ ListIndex ] [ j ]->SupplyPosition();
742 for (
unsigned i = 0; i < p_TheProbe->
m_NoAreas; i++ ) {
759 if (!RipleysOutputPrb) {
760 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
772 m_AOR_Probe =
new AOR_Probe(
this, m_TheLandscape, a_AORFilename);
779 RipleysOutputPrb1 = fopen(
"RipleyOutput_Jan.txt",
"w" );
780 if ( !RipleysOutputPrb1 ) {
781 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
785 RipleysOutputPrb2 = fopen(
"RipleyOutput_Feb.txt",
"w" );
786 if ( !RipleysOutputPrb2 ) {
787 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
791 RipleysOutputPrb3 = fopen(
"RipleyOutput_Mar.txt",
"w" );
792 if ( !RipleysOutputPrb3 ) {
793 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
797 RipleysOutputPrb4 = fopen(
"RipleyOutput_Apr.txt",
"w" );
798 if ( !RipleysOutputPrb4 ) {
799 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
803 RipleysOutputPrb5 = fopen(
"RipleyOutput_May.txt",
"w" );
804 if ( !RipleysOutputPrb5 ) {
805 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
809 RipleysOutputPrb6 = fopen(
"RipleyOutput_Jun.txt",
"w" );
810 if ( !RipleysOutputPrb6 ) {
811 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
815 RipleysOutputPrb7 = fopen(
"RipleyOutput_Jul.txt",
"w" );
816 if ( !RipleysOutputPrb7 ) {
817 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
821 RipleysOutputPrb8 = fopen(
"RipleyOutput_Aug.txt",
"w" );
822 if ( !RipleysOutputPrb8 ) {
823 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
827 RipleysOutputPrb9 = fopen(
"RipleyOutput_Sep.txt",
"w" );
828 if ( !RipleysOutputPrb9 ) {
829 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
833 RipleysOutputPrb10 = fopen(
"RipleyOutput_Oct.txt",
"w" );
834 if ( !RipleysOutputPrb10 ) {
835 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
839 RipleysOutputPrb11 = fopen(
"RipleyOutput_Nov.txt",
"w" );
840 if ( !RipleysOutputPrb11 ) {
841 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
845 RipleysOutputPrb12 = fopen(
"RipleyOutput_Dec.txt",
"w" );
846 if ( !RipleysOutputPrb12 ) {
847 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
861 if ( !ReallyBigOutputPrb ) {
862 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
876 fclose( RipleysOutputPrb );
877 RipleysOutputPrb=NULL;
886 fclose( RipleysOutputPrb1 );
887 fclose( RipleysOutputPrb2 );
888 fclose( RipleysOutputPrb3 );
889 fclose( RipleysOutputPrb4 );
890 fclose( RipleysOutputPrb5 );
891 fclose( RipleysOutputPrb6 );
892 fclose( RipleysOutputPrb7 );
893 fclose( RipleysOutputPrb8 );
894 fclose( RipleysOutputPrb9 );
895 fclose( RipleysOutputPrb10 );
896 fclose( RipleysOutputPrb11 );
897 fclose( RipleysOutputPrb12 );
905 if ( ReallyBigOutputPrb != 0 )
906 fclose( ReallyBigOutputPrb );
907 ReallyBigOutputPrb=0;
938 int distance = 100000000;
941 for (
unsigned j = 0; j < (unsigned)GetLiveArraySize( Type ); j++) {
943 dy = TheArray[ Type ] [ j ]->Supply_m_Location_y();
950 if ( d < distance ) {
952 TA = TheArray[ Type ] [ j ];
964 for (
unsigned i = 0; i < TheArray.size(); i++ )
967 for (
unsigned j = 0; j < (unsigned) TheArray[i].size(); j++)
969 delete TheArray[ i ] [ j ];
972 TheArray[ i ].clear();
980 vector<TAnimal*>::iterator nth = TheArray[Type].begin() + m_LiveArraySize[Type];
981 sort( TheArray[ Type ].begin(), nth,
CompareX() );
990 vector<TAnimal*>::iterator nth = TheArray[Type].begin() + m_LiveArraySize[Type];
991 sort(TheArray[Type].begin(), nth,
CompareY());
1000 sort( TheArray[ Type ].begin(), TheArray[ Type ].end(),
CompareState() );
1009 sort(TheArray[Type].begin(), TheArray[Type].begin()+m_LiveArraySize[Type],
CompareStateR());
1016 auto it = partition(TheArray[Type].begin(), TheArray[Type].begin() + m_LiveArraySize[Type],
CompareStateAlive());
1019 return unsigned(it - TheArray[Type].begin());
1028 vector<TAnimal*>::iterator nth = TheArray[Type].begin() + m_LiveArraySize[Type];
1029 sort(TheArray[Type].begin(), nth,
CompareX());
1030 unsigned s = (unsigned)GetLiveArraySize( Type );
1035 for (
unsigned i = 0; i < s; i++ ) {
1037 x = TheArray[ Type ] [ i ]->Supply_m_Location_x();
1039 while ( counter < x ) IndexArrayX[ Type ] [ counter++ ] = -1;
1040 if ( x == counter ) {
1041 IndexArrayX[ Type ] [ counter++ ] = i;
1045 for (
int c = counter; c < 10000; c++ ) {
1046 IndexArrayX[ Type ] [ c ] = -1;
1056 unsigned s = (unsigned)GetLiveArraySize( Type );
1057 for (
unsigned i = 0; i < s; i++ ) {
1059 unsigned a = random( s );
1060 unsigned b = random( s );
1061 temp = TheArray[ Type ] [ a ];
1062 TheArray[ Type ] [ a ] = TheArray[ Type ] [ b ];
1063 TheArray[ Type ] [ b ] = temp;
1074 switch ( BeforeStepActions[ Type ] ) {
1090 if (
g_rand_uni() <
double (1/500)) Shuffle( Type );
1093 m_TheLandscape->Warn(
"Population_Manager::Shuffle_or_Sort- BeforeStepAction Unknown", NULL );
1124 if ( a_species == 1 ) {
1211 ProbeReport( a_time );
1212 #ifdef __SpecificPesticideEffectsVinclozolinLike__
1213 ImpactProbeReport( a_time );
1215 #ifdef __WithinOrchardPesticideSim__
1216 ImpactProbeReport( a_time );
1221 else if ( a_species == 0 ) {
1223 int a_day = a_time % 365;
1224 if ( a_time % 365 == 364 )
1227 int BreedingFemales, YoungOfTheYear, TotalPop, TotalFemales, TotalMales, BreedingAttempts;
1228 No = TheBreedingSuccessProbe( BreedingFemales, YoungOfTheYear, TotalPop, TotalFemales, TotalMales, BreedingAttempts );
1230 if ( BreedingFemales > 0 ) {
1231 bs = No / ( float )BreedingFemales;
1233 BreedingSuccessProbeOutput( bs, BreedingFemales, YoungOfTheYear, TotalPop,
1234 TotalFemales, TotalMales, a_time, BreedingAttempts );
1236 if ( a_day == 152 ) {
1239 m_TheLandscape->FillVegAreaData();
1241 if ( a_day == 197 ) {
1242 for (
int ProbeNo = 0; ProbeNo < m_NoProbes; ProbeNo++ ) {
1243 No = TheFledgelingProbe();
1245 FledgelingProbeOutput( No, a_time );
1251 BreedingPairsOutput(a_day);
1253 ProbeReport( a_time );
1256 else return ProbeReport( a_time );
1263 unsigned int No = 0;
1264 unsigned sz = (unsigned)GetLiveArraySize( a_typeofanimal );
1265 for (
unsigned j = 0; j < sz; j++ )
1267 if (a_farm == TheArray[ a_typeofanimal ] [ j ]->SupplyFarmOwnerRef()) No++;
1278 for (
int ProbeNo = 0; ProbeNo < m_NoProbes; ProbeNo++ ) {
1282 if ( ( TheProbe[ ProbeNo ]->m_ReportInterval == 3 )
1283 || ( ( TheProbe[ ProbeNo ]->m_ReportInterval == 2 ) && ( BeginningOfMonth() ) )
1284 || ( ( TheProbe[ ProbeNo ]->m_ReportInterval == 1 ) && ( Time % 365 == 0 ) ) ) {
1286 unsigned Index = SupplyListIndexSize();
1287 for (
unsigned listindex = 0; listindex < Index; listindex++ ) {
1288 if ( TheProbe[ ProbeNo ]->m_TargetTypes[ listindex ] )
1289 No += (int) Probe( listindex, TheProbe[ ProbeNo ] );
1291 TheProbe[ ProbeNo ]->FileOutput( No, Time, ProbeNo );
1292 sprintf(str,
" %d ", No );
1304 for (
int ProbeNo = 0; ProbeNo < m_NoProbes; ProbeNo++ ) {
1306 unsigned Index = SupplyListIndexSize();
1307 for (
unsigned listindex = 0; listindex < Index; listindex++ ) {
1308 if ( TheProbe[ ProbeNo ]->m_TargetTypes[ listindex ] ) No += (int) Probe( listindex, TheProbe[ ProbeNo ] );
1310 TheProbe[ ProbeNo ]->FileOutput( No, Time, ProbeNo );
1311 sprintf(str,
" %d ", No );
1323 for (
int ProbeNo = 0; ProbeNo < 1; ProbeNo++ ) {
1326 if ( ( TheProbe[ ProbeNo ]->m_ReportInterval == 3 )
1327 || ( ( TheProbe[ ProbeNo ]->m_ReportInterval == 2 ) && ( BeginningOfMonth() ) )
1328 || ( ( TheProbe[ ProbeNo ]->m_ReportInterval == 1 ) && ( a_Time % 365 == 0 ) ) ) {
1347 SkP.
m_x = m_Location_x;
1348 SkP.
m_y = m_Location_y;
1349 SkP.
m_EleType = m_OurLandscape->SupplyElementType( m_Location_x, m_Location_y );
1350 SkP.
m_VegType = m_OurLandscape->SupplyVegType( m_Location_x, m_Location_y );
1360 return m_OurLandscape->SupplyFarmOwner( m_Location_x, m_Location_y );
1381 AmAlive = 0xDEADC0DE;
1384 m_CurrentStateNo = 0;
1407 while ( ( event = (
FarmToDo )m_OurLandscape->SupplyLastTreatment( m_Location_x, m_Location_y, & i ) ) !=
sleep_all_day ) {
1408 if ( OnFarmEvent( event ) )
break;
1420 while ( ( event = (
FarmToDo )m_OurLandscape->SupplyLastTreatment( x, y, & i ) ) !=
sleep_all_day ) {
1421 OnFarmEvent( event );
1434 void TALMaSSObject::DEADCODEError() {
1448 if ( m_FileRecord ) {
1450 if ( ProbeNo == 0 ) {
1452 (*m_MyFile) << endl;
1453 (*m_MyFile) << time <<
'\t' << No;
1455 (*m_MyFile) <<
'\t' << No ;
1457 (*m_MyFile).flush();
1463 m_MyFile->open(m_MyFileName,ios::app);
1464 if ( !m_MyFile->is_open() ) {
1468 if ( m_FileRecord ) {
1469 (*m_MyFile)<< time <<
'\t' << No << endl;
1481 m_FileRecord =
false;
1491 m_MyFile =
new ofstream( Nme );
1492 if ( !m_MyFile->is_open() ) {
1496 strcpy( m_MyFileName, Nme );
1520 if (TheArray[l][i]->Supply_m_Location_x() > 10000)
return true;
1521 if (TheArray[l][i]->Supply_m_Location_y() > 10000)
return true;
1522 if (TheArray[l][i]->Supply_m_Location_x() < 0)
return true;
1523 if (TheArray[l][i]->Supply_m_Location_y() < 0)
return true;