bin/ai/regression/regression.nut
branchnoai
changeset 9737 ee408edf3851
parent 9733 49e424cd4edd
child 9745 fb2454d70f37
equal deleted inserted replaced
9736:183b38e0a480 9737:ee408edf3851
    29 	print(" abs( 21): " + abs(21));
    29 	print(" abs( 21): " + abs(21));
    30 }
    30 }
    31 
    31 
    32 function Regression::Base()
    32 function Regression::Base()
    33 {
    33 {
    34 	local base = AIBase();
       
    35 
       
    36 	print("");
    34 	print("");
    37 	print("--AIBase--");
    35 	print("--AIBase--");
    38 	print("  Rand():       " + base.Rand());
    36 	print("  Rand():       " + AIBase.Rand());
    39 	print("  Rand():       " + base.Rand());
    37 	print("  Rand():       " + AIBase.Rand());
    40 	print("  Rand():       " + base.Rand());
    38 	print("  Rand():       " + AIBase.Rand());
    41 	print("  RandRange(0): " + base.RandRange(0));
    39 	print("  RandRange(0): " + AIBase.RandRange(0));
    42 	print("  RandRange(0): " + base.RandRange(0));
    40 	print("  RandRange(0): " + AIBase.RandRange(0));
    43 	print("  RandRange(0): " + base.RandRange(0));
    41 	print("  RandRange(0): " + AIBase.RandRange(0));
    44 	print("  RandRange(1): " + base.RandRange(1));
    42 	print("  RandRange(1): " + AIBase.RandRange(1));
    45 	print("  RandRange(1): " + base.RandRange(1));
    43 	print("  RandRange(1): " + AIBase.RandRange(1));
    46 	print("  RandRange(1): " + base.RandRange(1));
    44 	print("  RandRange(1): " + AIBase.RandRange(1));
    47 	print("  RandRange(2): " + base.RandRange(2));
    45 	print("  RandRange(2): " + AIBase.RandRange(2));
    48 	print("  RandRange(2): " + base.RandRange(2));
    46 	print("  RandRange(2): " + AIBase.RandRange(2));
    49 	print("  RandRange(2): " + base.RandRange(2));
    47 	print("  RandRange(2): " + AIBase.RandRange(2));
    50 	print("  RandRange(9): " + base.RandRange(9));
    48 	print("  RandRange(9): " + AIBase.RandRange(9));
    51 	print("  RandRange(9): " + base.RandRange(9));
    49 	print("  RandRange(9): " + AIBase.RandRange(9));
    52 	print("  RandRange(9): " + base.RandRange(9));
    50 	print("  RandRange(9): " + AIBase.RandRange(9));
    53 	print("  Chance(1, 2): " + base.Chance(1, 2));
    51 	print("  Chance(1, 2): " + AIBase.Chance(1, 2));
    54 	print("  Chance(1, 2): " + base.Chance(1, 2));
    52 	print("  Chance(1, 2): " + AIBase.Chance(1, 2));
    55 	print("  Chance(1, 2): " + base.Chance(1, 2));
    53 	print("  Chance(1, 2): " + AIBase.Chance(1, 2));
    56 }
    54 }
    57 
    55 
    58 function Regression::Airport()
    56 function Regression::Airport()
    59 {
    57 {
    60 	local airport = AIAirport();
       
    61 	local company = AICompany();
       
    62 
       
    63 	print("");
    58 	print("");
    64 	print("--AIAirport--");
    59 	print("--AIAirport--");
    65 
    60 
    66 	print("  IsHangarTile():       " + airport.IsHangarTile(32116));
    61 	print("  IsHangarTile():       " + AIAirport.IsHangarTile(32116));
    67 	print("  IsAirportTile():      " + airport.IsAirportTile(32116));
    62 	print("  IsAirportTile():      " + AIAirport.IsAirportTile(32116));
    68 	print("  GetHangarOfAirport(): " + airport.GetHangarOfAirport(32116));
    63 	print("  GetHangarOfAirport(): " + AIAirport.GetHangarOfAirport(32116));
    69 
    64 
    70 	for (local i = -1; i < 10; i++) {
    65 	for (local i = -1; i < 10; i++) {
    71 		print("  AiportAvailable(" + i + "):          " + airport.AiportAvailable(i));
    66 		print("  AiportAvailable(" + i + "):          " + AIAirport.AiportAvailable(i));
    72 		print("  GetAirportWidth(" + i + "):          " + airport.GetAirportWidth(i));
    67 		print("  GetAirportWidth(" + i + "):          " + AIAirport.GetAirportWidth(i));
    73 		print("  GetAirportHeight(" + i + "):         " + airport.GetAirportHeight(i));
    68 		print("  GetAirportHeight(" + i + "):         " + AIAirport.GetAirportHeight(i));
    74 		print("  GetAirportCoverageRadius(" + i + "): " + airport.GetAirportCoverageRadius(i));
    69 		print("  GetAirportCoverageRadius(" + i + "): " + AIAirport.GetAirportCoverageRadius(i));
    75 	}
    70 	}
    76 
    71 
    77 	print("  GetBankBalance():     " + company.GetBankBalance(AICompany.MY_COMPANY));
    72 	print("  GetBankBalance():     " + AICompany.GetBankBalance(AICompany.MY_COMPANY));
    78 	print("  BuildAirport():       " + airport.BuildAirport(32116, 0));
    73 	print("  BuildAirport():       " + AIAirport.BuildAirport(32116, 0));
    79 	print("  IsHangarTile():       " + airport.IsHangarTile(32116));
    74 	print("  IsHangarTile():       " + AIAirport.IsHangarTile(32116));
    80 	print("  IsAirportTile():      " + airport.IsAirportTile(32116));
    75 	print("  IsAirportTile():      " + AIAirport.IsAirportTile(32116));
    81 	print("  GetHangarOfAirport(): " + airport.GetHangarOfAirport(32116));
    76 	print("  GetHangarOfAirport(): " + AIAirport.GetHangarOfAirport(32116));
    82 	print("  IsHangarTile():       " + airport.IsHangarTile(32119));
    77 	print("  IsHangarTile():       " + AIAirport.IsHangarTile(32119));
    83 	print("  IsAirportTile():      " + airport.IsAirportTile(32119));
    78 	print("  IsAirportTile():      " + AIAirport.IsAirportTile(32119));
    84 	print("  GetBankBalance():     " + company.GetBankBalance(AICompany.MY_COMPANY));
    79 	print("  GetBankBalance():     " + AICompany.GetBankBalance(AICompany.MY_COMPANY));
    85 
    80 
    86 	print("  RemoveAirport():      " + airport.RemoveAirport(32118));
    81 	print("  RemoveAirport():      " + AIAirport.RemoveAirport(32118));
    87 	print("  IsHangarTile():       " + airport.IsHangarTile(32119));
    82 	print("  IsHangarTile():       " + AIAirport.IsHangarTile(32119));
    88 	print("  IsAirportTile():      " + airport.IsAirportTile(32119));
    83 	print("  IsAirportTile():      " + AIAirport.IsAirportTile(32119));
    89 	print("  GetBankBalance():     " + company.GetBankBalance(AICompany.MY_COMPANY));
    84 	print("  GetBankBalance():     " + AICompany.GetBankBalance(AICompany.MY_COMPANY));
    90 	print("  BuildAirport():       " + airport.BuildAirport(32116, 0));
    85 	print("  BuildAirport():       " + AIAirport.BuildAirport(32116, 0));
    91 }
    86 }
    92 
    87 
    93 function Regression::Cargo()
    88 function Regression::Cargo()
    94 {
    89 {
    95 	local cargo = AICargo();
       
    96 
       
    97 	print("");
    90 	print("");
    98 	print("--AICargo--");
    91 	print("--AICargo--");
    99 	for (local i = -1; i < 15; i++) {
    92 	for (local i = -1; i < 15; i++) {
   100 		print("  Cargo " + i);
    93 		print("  Cargo " + i);
   101 		print("    IsValidCargo():          " + cargo.IsValidCargo(i));
    94 		print("    IsValidCargo():          " + AICargo.IsValidCargo(i));
   102 		print("    GetCargoLabel():         '" + cargo.GetCargoLabel(i)+ "'");
    95 		print("    GetCargoLabel():         '" + AICargo.GetCargoLabel(i)+ "'");
   103 		print("    IsFreight():             " + cargo.IsFreight(i));
    96 		print("    IsFreight():             " + AICargo.IsFreight(i));
   104 		print("    GetCargoIncome(0, 0):    " + cargo.GetCargoIncome(0, 0, i));
    97 		print("    GetCargoIncome(0, 0):    " + AICargo.GetCargoIncome(0, 0, i));
   105 		print("    GetCargoIncome(10, 10):  " + cargo.GetCargoIncome(10, 10, i));
    98 		print("    GetCargoIncome(10, 10):  " + AICargo.GetCargoIncome(10, 10, i));
   106 		print("    GetCargoIncome(100, 10): " + cargo.GetCargoIncome(100, 10, i));
    99 		print("    GetCargoIncome(100, 10): " + AICargo.GetCargoIncome(100, 10, i));
   107 		print("    GetCargoIncome(10, 100): " + cargo.GetCargoIncome(10, 100, i));
   100 		print("    GetCargoIncome(10, 100): " + AICargo.GetCargoIncome(10, 100, i));
   108 	}
   101 	}
   109 }
   102 }
   110 
   103 
   111 function Regression::Company()
   104 function Regression::Company()
   112 {
   105 {
   113 	local company = AICompany();
       
   114 
       
   115 	print("");
   106 	print("");
   116 	print("--Company--");
   107 	print("--Company--");
   117 
   108 
   118 	/* Test AIXXXMode() in scopes */
   109 	/* Test AIXXXMode() in scopes */
   119 	{
   110 	{
   120 		local test = AITestMode();
   111 		local test = AITestMode();
   121 		print("  SetCompanyName():     " + company.SetCompanyName("Regression"));
   112 		print("  SetCompanyName():     " + AICompany.SetCompanyName("Regression"));
   122 		print("  SetCompanyName():     " + company.SetCompanyName("Regression"));
   113 		print("  SetCompanyName():     " + AICompany.SetCompanyName("Regression"));
   123 		{
   114 		{
   124 			local exec = AIExecMode();
   115 			local exec = AIExecMode();
   125 			print("  SetCompanyName():     " + company.SetCompanyName("Regression"));
   116 			print("  SetCompanyName():     " + AICompany.SetCompanyName("Regression"));
   126 			print("  SetCompanyName():     " + company.SetCompanyName("Regression"));
   117 			print("  SetCompanyName():     " + AICompany.SetCompanyName("Regression"));
   127 		}
   118 		}
   128 	}
   119 	}
   129 
   120 
   130 	print("  GetCompanyName():            " + company.GetCompanyName(AICompany.MY_COMPANY));
   121 	print("  GetCompanyName():            " + AICompany.GetCompanyName(AICompany.MY_COMPANY));
   131 	print("  GetPresidentName():          " + company.GetPresidentName(AICompany.MY_COMPANY));
   122 	print("  GetPresidentName():          " + AICompany.GetPresidentName(AICompany.MY_COMPANY));
   132 	print("  SetPresidentName():          " + company.SetPresidentName("Regression AI"));
   123 	print("  SetPresidentName():          " + AICompany.SetPresidentName("Regression AI"));
   133 	print("  GetPresidentName():          " + company.GetPresidentName(AICompany.MY_COMPANY));
   124 	print("  GetPresidentName():          " + AICompany.GetPresidentName(AICompany.MY_COMPANY));
   134 	print("  GetCompanyValue():           " + company.GetCompanyValue(AICompany.MY_COMPANY));
   125 	print("  GetCompanyValue():           " + AICompany.GetCompanyValue(AICompany.MY_COMPANY));
   135 	print("  GetBankBalance():            " + company.GetBankBalance(AICompany.MY_COMPANY));
   126 	print("  GetBankBalance():            " + AICompany.GetBankBalance(AICompany.MY_COMPANY));
   136 	print("  GetCompanyName():            " + company.GetCompanyName(240));
   127 	print("  GetCompanyName():            " + AICompany.GetCompanyName(240));
   137 	print("  GetLoanAmount():             " + company.GetLoanAmount());
   128 	print("  GetLoanAmount():             " + AICompany.GetLoanAmount());
   138 	print("  GetMaxLoanAmount():          " + company.GetMaxLoanAmount());
   129 	print("  GetMaxLoanAmount():          " + AICompany.GetMaxLoanAmount());
   139 	print("  GetLoanInterval():           " + company.GetLoanInterval());
   130 	print("  GetLoanInterval():           " + AICompany.GetLoanInterval());
   140 	print("  SetLoanAmount(1):            " + company.SetLoanAmount(1));
   131 	print("  SetLoanAmount(1):            " + AICompany.SetLoanAmount(1));
   141 	print("  SetLoanAmount(100):          " + company.SetLoanAmount(100));
   132 	print("  SetLoanAmount(100):          " + AICompany.SetLoanAmount(100));
   142 	print("  SetLoanAmount(10000):        " + company.SetLoanAmount(10000));
   133 	print("  SetLoanAmount(10000):        " + AICompany.SetLoanAmount(10000));
   143 	print("  GetBankBalance():            " + company.GetBankBalance(AICompany.MY_COMPANY));
   134 	print("  GetBankBalance():            " + AICompany.GetBankBalance(AICompany.MY_COMPANY));
   144 	print("  GetLoanAmount():             " + company.GetLoanAmount());
   135 	print("  GetLoanAmount():             " + AICompany.GetLoanAmount());
   145 	print("  SetMinimumLoanAmount(31337): " + company.SetMinimumLoanAmount(31337));
   136 	print("  SetMinimumLoanAmount(31337): " + AICompany.SetMinimumLoanAmount(31337));
   146 	print("  GetBankBalance():            " + company.GetBankBalance(AICompany.MY_COMPANY));
   137 	print("  GetBankBalance():            " + AICompany.GetBankBalance(AICompany.MY_COMPANY));
   147 	print("  GetLoanAmount():             " + company.GetLoanAmount());
   138 	print("  GetLoanAmount():             " + AICompany.GetLoanAmount());
   148 	print("  SetLoanAmount(10000):        " + company.SetLoanAmount(company.GetMaxLoanAmount()));
   139 	print("  SetLoanAmount(10000):        " + AICompany.SetLoanAmount(AICompany.GetMaxLoanAmount()));
   149 	print("  GetBankBalance():            " + company.GetBankBalance(AICompany.MY_COMPANY));
   140 	print("  GetBankBalance():            " + AICompany.GetBankBalance(AICompany.MY_COMPANY));
   150 	print("  GetLoanAmount():             " + company.GetLoanAmount());
   141 	print("  GetLoanAmount():             " + AICompany.GetLoanAmount());
   151 }
   142 }
   152 
   143 
   153 function Regression::Engine()
   144 function Regression::Engine()
   154 {
   145 {
   155 	local engine = AIEngine();
       
   156 	local j = 0;
   146 	local j = 0;
   157 
   147 
   158 	print("");
   148 	print("");
   159 	print("--Engine--");
   149 	print("--Engine--");
   160 	for (local i = -1; i < 257; i++) {
   150 	for (local i = -1; i < 257; i++) {
   161 		if (engine.IsValidEngine(i)) j++;
   151 		if (AIEngine.IsValidEngine(i)) j++;
   162 		print("  Engine " + i);
   152 		print("  Engine " + i);
   163 		print("    IsValidEngine():    " + engine.IsValidEngine(i));
   153 		print("    IsValidEngine():    " + AIEngine.IsValidEngine(i));
   164 		print("    GetName():          " + engine.GetName(i));
   154 		print("    GetName():          " + AIEngine.GetName(i));
   165 		print("    GetCargoType():     " + engine.GetCargoType(i));
   155 		print("    GetCargoType():     " + AIEngine.GetCargoType(i));
   166 		print("    GetCapacity():      " + engine.GetCapacity(i));
   156 		print("    GetCapacity():      " + AIEngine.GetCapacity(i));
   167 		print("    GetReliability():   " + engine.GetReliability(i));
   157 		print("    GetReliability():   " + AIEngine.GetReliability(i));
   168 		print("    GetMaxSpeed():      " + engine.GetMaxSpeed(i));
   158 		print("    GetMaxSpeed():      " + AIEngine.GetMaxSpeed(i));
   169 		print("    GetPrice():         " + engine.GetPrice(i));
   159 		print("    GetPrice():         " + AIEngine.GetPrice(i));
   170 		print("    GetMaxAge():        " + engine.GetMaxAge(i));
   160 		print("    GetMaxAge():        " + AIEngine.GetMaxAge(i));
   171 		print("    GetRunningCost():   " + engine.GetRunningCost(i));
   161 		print("    GetRunningCost():   " + AIEngine.GetRunningCost(i));
   172 		print("    GetName():          " + engine.GetName(i));
   162 		print("    GetName():          " + AIEngine.GetName(i));
   173 		print("    GetVehicleType():   " + engine.GetVehicleType(i));
   163 		print("    GetVehicleType():   " + AIEngine.GetVehicleType(i));
   174 	}
   164 	}
   175 	print("  Valid Engines:        " + j);
   165 	print("  Valid Engines:        " + j);
   176 }
   166 }
   177 
   167 
   178 function Regression::EngineList()
   168 function Regression::EngineList()
   250 	print("  GetNextEvent:      " + (e == null ? "null" : "instance"));
   240 	print("  GetNextEvent:      " + (e == null ? "null" : "instance"));
   251 }
   241 }
   252 
   242 
   253 function Regression::Industry()
   243 function Regression::Industry()
   254 {
   244 {
   255 	local industry = AIIndustry();
       
   256 	local j = 0;
   245 	local j = 0;
   257 
   246 
   258 	print("");
   247 	print("");
   259 	print("--Industry--");
   248 	print("--Industry--");
   260 	print("  GetMaxIndustryID():  " + industry.GetMaxIndustryID());
   249 	print("  GetMaxIndustryID():  " + AIIndustry.GetMaxIndustryID());
   261 	print("  GetIndustryCount():  " + industry.GetIndustryCount());
   250 	print("  GetIndustryCount():  " + AIIndustry.GetIndustryCount());
   262 	for (local i = -1; i < industry.GetMaxIndustryID() + 1; i++) {
   251 	for (local i = -1; i < AIIndustry.GetMaxIndustryID() + 1; i++) {
   263 		if (industry.IsValidIndustry(i)) j++;
   252 		if (AIIndustry.IsValidIndustry(i)) j++;
   264 		print("  Industry " + i);
   253 		print("  Industry " + i);
   265 		print("    IsValidIndustry(): " + industry.IsValidIndustry(i));
   254 		print("    IsValidIndustry(): " + AIIndustry.IsValidIndustry(i));
   266 		print("    GetName():         " + industry.GetName(i));
   255 		print("    GetName():         " + AIIndustry.GetName(i));
   267 		print("    GetLocation():     " + industry.GetLocation(i));
   256 		print("    GetLocation():     " + AIIndustry.GetLocation(i));
   268 		print("    GetProduction():   " + industry.GetProduction(i, 1));
   257 		print("    GetProduction():   " + AIIndustry.GetProduction(i, 1));
   269 		print("    IsCargoAccepted(): " + industry.IsCargoAccepted(i, 1));
   258 		print("    IsCargoAccepted(): " + AIIndustry.IsCargoAccepted(i, 1));
   270 	}
   259 	}
   271 	print("  Valid Industries:    " + j);
   260 	print("  Valid Industries:    " + j);
   272 	print("  GetIndustryCount():  " + industry.GetIndustryCount());
   261 	print("  GetIndustryCount():  " + AIIndustry.GetIndustryCount());
   273 }
   262 }
   274 
   263 
   275 function Regression::IndustryList()
   264 function Regression::IndustryList()
   276 {
   265 {
   277 	local list = AIIndustryList();
   266 	local list = AIIndustryList();
   380 	print("  IsEmpty():     " + list.IsEmpty());
   369 	print("  IsEmpty():     " + list.IsEmpty());
   381 }
   370 }
   382 
   371 
   383 function Regression::Map()
   372 function Regression::Map()
   384 {
   373 {
   385 	local map = AIMap();
       
   386 
       
   387 	print("");
   374 	print("");
   388 	print("--Map--");
   375 	print("--Map--");
   389 	print("  GetMapSize():     " + map.GetMapSize());
   376 	print("  GetMapSize():     " + AIMap.GetMapSize());
   390 	print("  GetMapSizeX():    " + map.GetMapSizeX());
   377 	print("  GetMapSizeX():    " + AIMap.GetMapSizeX());
   391 	print("  GetMapSizeY():    " + map.GetMapSizeY());
   378 	print("  GetMapSizeY():    " + AIMap.GetMapSizeY());
   392 	print("  GetTileX(123):    " + map.GetTileX(123));
   379 	print("  GetTileX(123):    " + AIMap.GetTileX(123));
   393 	print("  GetTileY(123):    " + map.GetTileY(123));
   380 	print("  GetTileY(123):    " + AIMap.GetTileY(123));
   394 	print("  GetTileIndex():   " + map.GetTileIndex(123, 0));
   381 	print("  GetTileIndex():   " + AIMap.GetTileIndex(123, 0));
   395 	print("  GetTileIndex():   " + map.GetTileIndex(0, 123));
   382 	print("  GetTileIndex():   " + AIMap.GetTileIndex(0, 123));
   396 	print("  GetTileIndex():   " + map.GetTileIndex(0, 0));
   383 	print("  GetTileIndex():   " + AIMap.GetTileIndex(0, 0));
   397 	print("  GetTileIndex():   " + map.GetTileIndex(-1, -1));
   384 	print("  GetTileIndex():   " + AIMap.GetTileIndex(-1, -1));
   398 	print("  GetTileIndex():   " + map.GetTileIndex(10000, 10000));
   385 	print("  GetTileIndex():   " + AIMap.GetTileIndex(10000, 10000));
   399 	print("  IsValidTile(123): " + map.IsValidTile(123));
   386 	print("  IsValidTile(123): " + AIMap.IsValidTile(123));
   400 	print("  GetTileX(124):    " + map.GetTileX(124));
   387 	print("  GetTileX(124):    " + AIMap.GetTileX(124));
   401 	print("  GetTileY(124):    " + map.GetTileY(124));
   388 	print("  GetTileY(124):    " + AIMap.GetTileY(124));
   402 	print("  IsValidTile(124): " + map.IsValidTile(124));
   389 	print("  IsValidTile(124): " + AIMap.IsValidTile(124));
   403 	print("  IsValidTile(0):   " + map.IsValidTile(0));
   390 	print("  IsValidTile(0):   " + AIMap.IsValidTile(0));
   404 	print("  IsValidTile(-1):  " + map.IsValidTile(-1));
   391 	print("  IsValidTile(-1):  " + AIMap.IsValidTile(-1));
   405 	print("  IsValidTile():    " + map.IsValidTile(map.GetMapSize()));
   392 	print("  IsValidTile():    " + AIMap.IsValidTile(AIMap.GetMapSize()));
   406 	print("  IsValidTile():    " + map.IsValidTile(map.GetMapSize() - 1));
   393 	print("  IsValidTile():    " + AIMap.IsValidTile(AIMap.GetMapSize() - 1));
   407 	print("  DemolishTile():   " + map.DemolishTile(19592));
   394 	print("  DemolishTile():   " + AIMap.DemolishTile(19592));
   408 	print("  DemolishTile():   " + map.DemolishTile(19335));
   395 	print("  DemolishTile():   " + AIMap.DemolishTile(19335));
   409 	print("  Distance");
   396 	print("  Distance");
   410 	print("    DistanceManhattan(): " + map.DistanceManhattan(1, 10000));
   397 	print("    DistanceManhattan(): " + AIMap.DistanceManhattan(1, 10000));
   411 	print("    DistanceMax():       " + map.DistanceMax(1, 10000));
   398 	print("    DistanceMax():       " + AIMap.DistanceMax(1, 10000));
   412 	print("    DistanceSquare():    " + map.DistanceSquare(1, 10000));
   399 	print("    DistanceSquare():    " + AIMap.DistanceSquare(1, 10000));
   413 	print("    DistanceFromEdge():  " + map.DistanceFromEdge(10000));
   400 	print("    DistanceFromEdge():  " + AIMap.DistanceFromEdge(10000));
   414 }
   401 }
   415 
   402 
   416 function Regression::Marine()
   403 function Regression::Marine()
   417 {
   404 {
   418 	local marine = AIMarine();
       
   419 	local company = AICompany();
       
   420 
       
   421 	print("");
   405 	print("");
   422 	print("--AIMarine--");
   406 	print("--AIMarine--");
   423 
   407 
   424 	print("  IsWaterDepotTile():   " + marine.IsWaterDepotTile(32116));
   408 	print("  IsWaterDepotTile():   " + AIMarine.IsWaterDepotTile(32116));
   425 	print("  IsDockTile():         " + marine.IsDockTile(32116));
   409 	print("  IsDockTile():         " + AIMarine.IsDockTile(32116));
   426 	print("  IsBuoyTile():         " + marine.IsBuoyTile(32116));
   410 	print("  IsBuoyTile():         " + AIMarine.IsBuoyTile(32116));
   427 	print("  IsLockTile():         " + marine.IsLockTile(32116));
   411 	print("  IsLockTile():         " + AIMarine.IsLockTile(32116));
   428 	print("  IsCanalTile():        " + marine.IsCanalTile(32116));
   412 	print("  IsCanalTile():        " + AIMarine.IsCanalTile(32116));
   429 
   413 
   430 	print("  GetBankBalance():     " + company.GetBankBalance(AICompany.MY_COMPANY));
   414 	print("  GetBankBalance():     " + AICompany.GetBankBalance(AICompany.MY_COMPANY));
   431 	print("  BuildWaterDepot():    " + marine.BuildWaterDepot(28479, false));
   415 	print("  BuildWaterDepot():    " + AIMarine.BuildWaterDepot(28479, false));
   432 	print("  BuildDock():          " + marine.BuildDock(29253));
   416 	print("  BuildDock():          " + AIMarine.BuildDock(29253));
   433 	print("  BuildBuoy():          " + marine.BuildBuoy(28481));
   417 	print("  BuildBuoy():          " + AIMarine.BuildBuoy(28481));
   434 	print("  BuildLock():          " + marine.BuildLock(28487));
   418 	print("  BuildLock():          " + AIMarine.BuildLock(28487));
   435 	print("  BuildCanal():         " + marine.BuildCanal(32127));
   419 	print("  BuildCanal():         " + AIMarine.BuildCanal(32127));
   436 	print("  IsWaterDepotTile():   " + marine.IsWaterDepotTile(28479));
   420 	print("  IsWaterDepotTile():   " + AIMarine.IsWaterDepotTile(28479));
   437 	print("  IsDockTile():         " + marine.IsDockTile(29253));
   421 	print("  IsDockTile():         " + AIMarine.IsDockTile(29253));
   438 	print("  IsBuoyTile():         " + marine.IsBuoyTile(28481));
   422 	print("  IsBuoyTile():         " + AIMarine.IsBuoyTile(28481));
   439 	print("  IsLockTile():         " + marine.IsLockTile(28487));
   423 	print("  IsLockTile():         " + AIMarine.IsLockTile(28487));
   440 	print("  IsCanalTile():        " + marine.IsCanalTile(32127));
   424 	print("  IsCanalTile():        " + AIMarine.IsCanalTile(32127));
   441 	print("  GetBankBalance():     " + company.GetBankBalance(AICompany.MY_COMPANY));
   425 	print("  GetBankBalance():     " + AICompany.GetBankBalance(AICompany.MY_COMPANY));
   442 
   426 
   443 	print("  RemoveWaterDepot():   " + marine.RemoveWaterDepot(28479));
   427 	print("  RemoveWaterDepot():   " + AIMarine.RemoveWaterDepot(28479));
   444 	print("  RemoveDock():         " + marine.RemoveDock(29253));
   428 	print("  RemoveDock():         " + AIMarine.RemoveDock(29253));
   445 	print("  RemoveBuoy():         " + marine.RemoveBuoy(28481));
   429 	print("  RemoveBuoy():         " + AIMarine.RemoveBuoy(28481));
   446 	print("  RemoveLock():         " + marine.RemoveLock(28487));
   430 	print("  RemoveLock():         " + AIMarine.RemoveLock(28487));
   447 	print("  RemoveCanal():        " + marine.RemoveCanal(32127));
   431 	print("  RemoveCanal():        " + AIMarine.RemoveCanal(32127));
   448 	print("  IsWaterDepotTile():   " + marine.IsWaterDepotTile(28479));
   432 	print("  IsWaterDepotTile():   " + AIMarine.IsWaterDepotTile(28479));
   449 	print("  IsDockTile():         " + marine.IsDockTile(29253));
   433 	print("  IsDockTile():         " + AIMarine.IsDockTile(29253));
   450 	print("  IsBuoyTile():         " + marine.IsBuoyTile(28481));
   434 	print("  IsBuoyTile():         " + AIMarine.IsBuoyTile(28481));
   451 	print("  IsLockTile():         " + marine.IsLockTile(28487));
   435 	print("  IsLockTile():         " + AIMarine.IsLockTile(28487));
   452 	print("  IsCanalTile():        " + marine.IsCanalTile(32127));
   436 	print("  IsCanalTile():        " + AIMarine.IsCanalTile(32127));
   453 	print("  GetBankBalance():     " + company.GetBankBalance(AICompany.MY_COMPANY));
   437 	print("  GetBankBalance():     " + AICompany.GetBankBalance(AICompany.MY_COMPANY));
   454 
   438 
   455 	print("  BuildWaterDepot():    " + marine.BuildWaterDepot(28479, false));
   439 	print("  BuildWaterDepot():    " + AIMarine.BuildWaterDepot(28479, false));
   456 	print("  BuildDock():          " + marine.BuildDock(29253));
   440 	print("  BuildDock():          " + AIMarine.BuildDock(29253));
   457 }
   441 }
   458 
   442 
   459 function Regression::Order()
   443 function Regression::Order()
   460 {
   444 {
   461 	local order = AIOrder();
       
   462 
       
   463 	print("");
   445 	print("");
   464 	print("--Order--");
   446 	print("--Order--");
   465 	print("  GetNumberOfOrders():   " + order.GetNumberOfOrders(11));
   447 	print("  GetNumberOfOrders():   " + AIOrder.GetNumberOfOrders(11));
   466 	print("  GetOrderDestination(): " + order.GetOrderDestination(11, 1));
   448 	print("  GetOrderDestination(): " + AIOrder.GetOrderDestination(11, 1));
   467 	print("  AreOrderFlagsValid():  " + order.AreOrderFlagsValid(33416, AIOrder.AIOF_TRANSFER));
   449 	print("  AreOrderFlagsValid():  " + AIOrder.AreOrderFlagsValid(33416, AIOrder.AIOF_TRANSFER));
   468 	print("  IsValidVehicleOrder(): " + order.IsValidVehicleOrder(11, 1));
   450 	print("  IsValidVehicleOrder(): " + AIOrder.IsValidVehicleOrder(11, 1));
   469 	print("  GetOrderFlags():       " + order.GetOrderFlags(11, 1));
   451 	print("  GetOrderFlags():       " + AIOrder.GetOrderFlags(11, 1));
   470 	print("  AppendOrder():         " + order.AppendOrder(11, 33416, AIOrder.AIOF_TRANSFER));
   452 	print("  AppendOrder():         " + AIOrder.AppendOrder(11, 33416, AIOrder.AIOF_TRANSFER));
   471 	print("  InsertOrder():         " + order.InsertOrder(11, 0, 33416, AIOrder.AIOF_TRANSFER));
   453 	print("  InsertOrder():         " + AIOrder.InsertOrder(11, 0, 33416, AIOrder.AIOF_TRANSFER));
   472 	print("  GetNumberOfOrders():   " + order.GetNumberOfOrders(11));
   454 	print("  GetNumberOfOrders():   " + AIOrder.GetNumberOfOrders(11));
   473 	print("  IsValidVehicleOrder(): " + order.IsValidVehicleOrder(11, 1));
   455 	print("  IsValidVehicleOrder(): " + AIOrder.IsValidVehicleOrder(11, 1));
   474 	print("  RemoveOrder():         " + order.RemoveOrder(11, 0));
   456 	print("  RemoveOrder():         " + AIOrder.RemoveOrder(11, 0));
   475 	print("  ChangeOrder():         " + order.ChangeOrder(11, 0, AIOrder.AIOF_FULL_LOAD));
   457 	print("  ChangeOrder():         " + AIOrder.ChangeOrder(11, 0, AIOrder.AIOF_FULL_LOAD));
   476 	print("  GetOrderDestination(): " + order.GetOrderDestination(11, 0));
   458 	print("  GetOrderDestination(): " + AIOrder.GetOrderDestination(11, 0));
   477 	print("  CopyOrders():          " + order.CopyOrders(11, 1));
   459 	print("  CopyOrders():          " + AIOrder.CopyOrders(11, 1));
   478 	print("  CopyOrders():          " + order.CopyOrders(12, 11));
   460 	print("  CopyOrders():          " + AIOrder.CopyOrders(12, 11));
   479 	print("  ShareOrders():         " + order.ShareOrders(12, 1));
   461 	print("  ShareOrders():         " + AIOrder.ShareOrders(12, 1));
   480 	print("  ShareOrders():         " + order.ShareOrders(12, 11));
   462 	print("  ShareOrders():         " + AIOrder.ShareOrders(12, 11));
   481 	print("  UnshareOrders():       " + order.UnshareOrders(12));
   463 	print("  UnshareOrders():       " + AIOrder.UnshareOrders(12));
   482 	print("  AppendOrder():         " + order.AppendOrder(11, 33421, AIOrder.AIOF_NONE));
   464 	print("  AppendOrder():         " + AIOrder.AppendOrder(11, 33421, AIOrder.AIOF_NONE));
   483 
   465 
   484 	local list = AIVehicleStationList(11);
   466 	local list = AIVehicleStationList(11);
   485 
   467 
   486 	print("");
   468 	print("");
   487 	print("--VehicleStationList--");
   469 	print("--VehicleStationList--");
   543 	local ret = pf.FindRoute(start, end);
   525 	local ret = pf.FindRoute(start, end);
   544 	print("  FindRoute():  " + (ret ? "Route Array" : "Nil"));
   526 	print("  FindRoute():  " + (ret ? "Route Array" : "Nil"));
   545 	print("  BuildRoute(): " + pf.BuildRoute(ret));
   527 	print("  BuildRoute(): " + pf.BuildRoute(ret));
   546 	pf.FreeRoute(ret);
   528 	pf.FreeRoute(ret);
   547 
   529 
   548 	local road = AIRoad();
   530 	print("  IsRoadTile(): " + AIRoad.IsRoadTile(33425));
   549 	print("  IsRoadTile(): " + road.IsRoadTile(33425));
   531 	print("  IsRoadTile(): " + AIRoad.IsRoadTile(33480 + 256 * 5));
   550 	print("  IsRoadTile(): " + road.IsRoadTile(33480 + 256 * 5));
       
   551 }
   532 }
   552 
   533 
   553 function Regression::Road()
   534 function Regression::Road()
   554 {
   535 {
   555 	local road = AIRoad();
       
   556 
       
   557 	print("");
   536 	print("");
   558 	print("--Road--");
   537 	print("--Road--");
   559 	print("  Road");
   538 	print("  Road");
   560 	print("    IsRoadTile():                  " + road.IsRoadTile(33411));
   539 	print("    IsRoadTile():                  " + AIRoad.IsRoadTile(33411));
   561 	print("    BuildRoad():                   " + road.BuildRoad(0, 1));
   540 	print("    BuildRoad():                   " + AIRoad.BuildRoad(0, 1));
   562 	print("    BuildRoad():                   " + road.BuildRoad(33411, 33411));
   541 	print("    BuildRoad():                   " + AIRoad.BuildRoad(33411, 33411));
   563 	print("    BuildRoad():                   " + road.BuildRoad(33411, 33414));
   542 	print("    BuildRoad():                   " + AIRoad.BuildRoad(33411, 33414));
   564 	print("    AreRoadTilesConnected():       " + road.AreRoadTilesConnected(33412, 33413));
   543 	print("    AreRoadTilesConnected():       " + AIRoad.AreRoadTilesConnected(33412, 33413));
   565 	print("    IsRoadTile():                  " + road.IsRoadTile(33411));
   544 	print("    IsRoadTile():                  " + AIRoad.IsRoadTile(33411));
   566 	print("    GetNeighbourRoadCount():       " + road.GetNeighbourRoadCount(33412));
   545 	print("    GetNeighbourRoadCount():       " + AIRoad.GetNeighbourRoadCount(33412));
   567 	print("    RemoveRoad():                  " + road.RemoveRoad(33411, 33411));
   546 	print("    RemoveRoad():                  " + AIRoad.RemoveRoad(33411, 33411));
   568 	print("    RemoveRoad():                  " + road.RemoveRoad(33411, 33412));
   547 	print("    RemoveRoad():                  " + AIRoad.RemoveRoad(33411, 33412));
   569 	print("    RemoveRoad():                  " + road.RemoveRoad(19590, 19590));
   548 	print("    RemoveRoad():                  " + AIRoad.RemoveRoad(19590, 19590));
   570 
   549 
   571 	print("  Depot");
   550 	print("  Depot");
   572 	print("    IsRoadTile():                  " + road.IsRoadTile(33411));
   551 	print("    IsRoadTile():                  " + AIRoad.IsRoadTile(33411));
   573 	print("    BuildRoadDepot():              " + road.BuildRoadDepot(0, 1));
   552 	print("    BuildRoadDepot():              " + AIRoad.BuildRoadDepot(0, 1));
   574 	print("    BuildRoadDepot():              " + road.BuildRoadDepot(33411, 33411));
   553 	print("    BuildRoadDepot():              " + AIRoad.BuildRoadDepot(33411, 33411));
   575 	print("    BuildRoadDepot():              " + road.BuildRoadDepot(33411, 33414));
   554 	print("    BuildRoadDepot():              " + AIRoad.BuildRoadDepot(33411, 33414));
   576 	print("    BuildRoadDepot():              " + road.BuildRoadDepot(33411, 33412));
   555 	print("    BuildRoadDepot():              " + AIRoad.BuildRoadDepot(33411, 33412));
   577 	print("    IsRoadTile():                  " + road.IsRoadTile(33411));
   556 	print("    IsRoadTile():                  " + AIRoad.IsRoadTile(33411));
   578 	print("    GetRoadDepotFrontTile():       " + road.GetRoadDepotFrontTile(33411));
   557 	print("    GetRoadDepotFrontTile():       " + AIRoad.GetRoadDepotFrontTile(33411));
   579 	print("    IsRoadDepotTile():             " + road.IsRoadDepotTile(33411));
   558 	print("    IsRoadDepotTile():             " + AIRoad.IsRoadDepotTile(33411));
   580 	print("    RemoveRoadDepot():             " + road.RemoveRoadDepot(33411));
   559 	print("    RemoveRoadDepot():             " + AIRoad.RemoveRoadDepot(33411));
   581 	print("    RemoveRoadDepot():             " + road.RemoveRoadDepot(33411));
   560 	print("    RemoveRoadDepot():             " + AIRoad.RemoveRoadDepot(33411));
   582 
   561 
   583 	print("  Station");
   562 	print("  Station");
   584 	print("    IsRoadTile():                  " + road.IsRoadTile(33411));
   563 	print("    IsRoadTile():                  " + AIRoad.IsRoadTile(33411));
   585 	print("    BuildRoadStation():            " + road.BuildRoadStation(0, 1, false, false));
   564 	print("    BuildRoadStation():            " + AIRoad.BuildRoadStation(0, 1, false, false));
   586 	print("    BuildRoadStation():            " + road.BuildRoadStation(33411, 33411, false, false));
   565 	print("    BuildRoadStation():            " + AIRoad.BuildRoadStation(33411, 33411, false, false));
   587 	print("    BuildRoadStation():            " + road.BuildRoadStation(33411, 33414, false, false));
   566 	print("    BuildRoadStation():            " + AIRoad.BuildRoadStation(33411, 33414, false, false));
   588 	print("    BuildRoadStation():            " + road.BuildRoadStation(33411, 33412, false, false));
   567 	print("    BuildRoadStation():            " + AIRoad.BuildRoadStation(33411, 33412, false, false));
   589 	print("    IsRoadTile():                  " + road.IsRoadTile(33411));
   568 	print("    IsRoadTile():                  " + AIRoad.IsRoadTile(33411));
   590 	print("    GetDriveThroughBackTile():     " + road.GetDriveThroughBackTile(33411));
   569 	print("    GetDriveThroughBackTile():     " + AIRoad.GetDriveThroughBackTile(33411));
   591 	print("    GetRoadStationFrontTile():     " + road.GetRoadStationFrontTile(33411));
   570 	print("    GetRoadStationFrontTile():     " + AIRoad.GetRoadStationFrontTile(33411));
   592 	print("    IsRoadStationTile():           " + road.IsRoadStationTile(33411));
   571 	print("    IsRoadStationTile():           " + AIRoad.IsRoadStationTile(33411));
   593 	print("    IsDriveThroughRoadStationTile: " + road.IsDriveThroughRoadStationTile(33411));
   572 	print("    IsDriveThroughRoadStationTile: " + AIRoad.IsDriveThroughRoadStationTile(33411));
   594 	print("    RemoveRoadStation():           " + road.RemoveRoadStation(33411));
   573 	print("    RemoveRoadStation():           " + AIRoad.RemoveRoadStation(33411));
   595 	print("    RemoveRoadStation():           " + road.RemoveRoadStation(33411));
   574 	print("    RemoveRoadStation():           " + AIRoad.RemoveRoadStation(33411));
   596 
   575 
   597 	print("  Station Types");
   576 	print("  Station Types");
   598 	print("    BuildRoadStation(bus):         " + road.BuildRoadStation(33411, 33410, false, false));
   577 	print("    BuildRoadStation(bus):         " + AIRoad.BuildRoadStation(33411, 33410, false, false));
   599 	print("    BuildRoadStation(truck):       " + road.BuildRoadStation(33421, 33422, true,  false));
   578 	print("    BuildRoadStation(truck):       " + AIRoad.BuildRoadStation(33421, 33422, true,  false));
   600 	print("    BuildRoadStation(truck):       " + road.BuildRoadStation(33412, 33413, true,  false));
   579 	print("    BuildRoadStation(truck):       " + AIRoad.BuildRoadStation(33412, 33413, true,  false));
   601 	print("    BuildRoadStation(bus):         " + road.BuildRoadStation(33411 + 256, 33411, false, false));
   580 	print("    BuildRoadStation(bus):         " + AIRoad.BuildRoadStation(33411 + 256, 33411, false, false));
   602 	print("    BuildRoadStation(truck):       " + road.BuildRoadStation(33412 + 256, 33412 + 256 + 256, true,  false));
   581 	print("    BuildRoadStation(truck):       " + AIRoad.BuildRoadStation(33412 + 256, 33412 + 256 + 256, true,  false));
   603 	print("    BuildRoadStation(bus-drive):   " + road.BuildRoadStation(33413, 33412, false, true));
   582 	print("    BuildRoadStation(bus-drive):   " + AIRoad.BuildRoadStation(33413, 33412, false, true));
   604 	print("    BuildRoadStation(truck-drive): " + road.BuildRoadStation(33414, 33413, true,  true));
   583 	print("    BuildRoadStation(truck-drive): " + AIRoad.BuildRoadStation(33414, 33413, true,  true));
   605 	print("    BuildRoadStation(bus-drive):   " + road.BuildRoadStation(33415, 33414, false, true));
   584 	print("    BuildRoadStation(bus-drive):   " + AIRoad.BuildRoadStation(33415, 33414, false, true));
   606 	print("    BuildRoadStation(truck-drive): " + road.BuildRoadStation(33416, 33415, true,  true));
   585 	print("    BuildRoadStation(truck-drive): " + AIRoad.BuildRoadStation(33416, 33415, true,  true));
   607 	print("    BuildRoadDepot():              " + road.BuildRoadDepot(33417, 33418));
   586 	print("    BuildRoadDepot():              " + AIRoad.BuildRoadDepot(33417, 33418));
   608 	print("    GetRoadStationFrontTile():     " + road.GetRoadStationFrontTile(33411 + 256));
   587 	print("    GetRoadStationFrontTile():     " + AIRoad.GetRoadStationFrontTile(33411 + 256));
   609 	print("    GetRoadStationFrontTile():     " + road.GetRoadStationFrontTile(33412 + 256));
   588 	print("    GetRoadStationFrontTile():     " + AIRoad.GetRoadStationFrontTile(33412 + 256));
   610 	print("    IsDriveThroughRoadStationTile: " + road.IsDriveThroughRoadStationTile(33415));
   589 	print("    IsDriveThroughRoadStationTile: " + AIRoad.IsDriveThroughRoadStationTile(33415));
   611 	print("    GetDriveThroughBackTile():     " + road.GetDriveThroughBackTile(33415));
   590 	print("    GetDriveThroughBackTile():     " + AIRoad.GetDriveThroughBackTile(33415));
   612 	print("    GetRoadStationFrontTile():     " + road.GetRoadStationFrontTile(33415));
   591 	print("    GetRoadStationFrontTile():     " + AIRoad.GetRoadStationFrontTile(33415));
   613 	print("    IsRoadTile():                  " + road.IsRoadTile(33415));
   592 	print("    IsRoadTile():                  " + AIRoad.IsRoadTile(33415));
   614 }
   593 }
   615 
   594 
   616 function Regression::Sign()
   595 function Regression::Sign()
   617 {
   596 {
   618 	local sign = AISign();
       
   619 	local j = 0;
   597 	local j = 0;
   620 
   598 
   621 	print("");
   599 	print("");
   622 	print("--Sign--");
   600 	print("--Sign--");
   623 	print("  BuildSign(33410, 'Some Sign'):       " + sign.BuildSign(33410, "Some Sign"));
   601 	print("  BuildSign(33410, 'Some Sign'):       " + AISign.BuildSign(33410, "Some Sign"));
   624 	local sign_id = sign.BuildSign(33409, "Some other Sign");
   602 	local AISign_id = AISign.BuildSign(33409, "Some other Sign");
   625 	print("  BuildSign(33409, 'Some other Sign'): " + sign_id);
   603 	print("  BuildSign(33409, 'Some other Sign'): " + AISign_id);
   626 	print("  RemoveSign(" + sign_id + "):                       " + sign.RemoveSign(sign_id));
   604 	print("  RemoveSign(" + AISign_id + "):                       " + AISign.RemoveSign(AISign_id));
   627 	print("");
   605 	print("");
   628 	print("  GetMaxSignID():    " + sign.GetMaxSignID());
   606 	print("  GetMaxSignID():    " + AISign.GetMaxSignID());
   629 	print("  GetSignCount():    " + sign.GetSignCount());
   607 	print("  GetSignCount():    " + AISign.GetSignCount());
   630 	for (local i = -1; i < sign.GetMaxSignID() + 1; i++) {
   608 	for (local i = -1; i < AISign.GetMaxSignID() + 1; i++) {
   631 		if (sign.IsValidSign(i)) j++;
   609 		if (AISign.IsValidSign(i)) j++;
   632 		print("  Sign " + i);
   610 		print("  Sign " + i);
   633 		print("    IsValidSign():   " + sign.IsValidSign(i));
   611 		print("    IsValidSign():   " + AISign.IsValidSign(i));
   634 		print("    GetText():       " + sign.GetText(i));
   612 		print("    GetText():       " + AISign.GetText(i));
   635 		print("    GetLocation():   " + sign.GetLocation(i));
   613 		print("    GetLocation():   " + AISign.GetLocation(i));
   636 	}
   614 	}
   637 	print("  Valid Signs:       " + j);
   615 	print("  Valid Signs:       " + j);
   638 	print("  GetSignCount():    " + sign.GetSignCount());
   616 	print("  GetSignCount():    " + AISign.GetSignCount());
   639 }
   617 }
   640 
   618 
   641 function Regression::Station()
   619 function Regression::Station()
   642 {
   620 {
   643 	local station = AIStation();
       
   644 
       
   645 	print("");
   621 	print("");
   646 	print("--Station--");
   622 	print("--Station--");
   647 	print("  IsValidStation(0):        " + station.IsValidStation(0));
   623 	print("  IsValidStation(0):        " + AIStation.IsValidStation(0));
   648 	print("  IsValidStation(1000):     " + station.IsValidStation(1000));
   624 	print("  IsValidStation(1000):     " + AIStation.IsValidStation(1000));
   649 	print("  GetName(0):               " + station.GetName(0));
   625 	print("  GetName(0):               " + AIStation.GetName(0));
   650 	print("  GetLocation(1):           " + station.GetLocation(1));
   626 	print("  GetLocation(1):           " + AIStation.GetLocation(1));
   651 	print("  GetLocation(1000):        " + station.GetLocation(1000));
   627 	print("  GetLocation(1000):        " + AIStation.GetLocation(1000));
   652 	print("  GetStationID(33411):      " + station.GetStationID(33411));
   628 	print("  GetStationID(33411):      " + AIStation.GetStationID(33411));
   653 	print("  GetStationID(34411):      " + station.GetStationID(34411));
   629 	print("  GetStationID(34411):      " + AIStation.GetStationID(34411));
   654 	print("  GetCargoWaiting(0, 0):    " + station.GetCargoWaiting(0, 0));
   630 	print("  GetCargoWaiting(0, 0):    " + AIStation.GetCargoWaiting(0, 0));
   655 	print("  GetCargoWaiting(1000, 0): " + station.GetCargoWaiting(1000, 0));
   631 	print("  GetCargoWaiting(1000, 0): " + AIStation.GetCargoWaiting(1000, 0));
   656 	print("  GetCargoWaiting(0, 1000): " + station.GetCargoWaiting(0, 1000));
   632 	print("  GetCargoWaiting(0, 1000): " + AIStation.GetCargoWaiting(0, 1000));
   657 
   633 
   658 	print("  GetCoverageRadius(bus):   " + station.GetCoverageRadius(AIStation.STATION_BUS_STOP));
   634 	print("  GetCoverageRadius(bus):   " + AIStation.GetCoverageRadius(AIStation.STATION_BUS_STOP));
   659 	print("  GetCoverageRadius(truck): " + station.GetCoverageRadius(AIStation.STATION_TRUCK_STOP));
   635 	print("  GetCoverageRadius(truck): " + AIStation.GetCoverageRadius(AIStation.STATION_TRUCK_STOP));
   660 	print("  GetCoverageRadius(train): " + station.GetCoverageRadius(AIStation.STATION_TRAIN));
   636 	print("  GetCoverageRadius(train): " + AIStation.GetCoverageRadius(AIStation.STATION_TRAIN));
   661 
   637 
   662 	local list = AIStationList(AIStation.STATION_BUS_STOP + AIStation.STATION_TRUCK_STOP);
   638 	local list = AIStationList(AIStation.STATION_BUS_STOP + AIStation.STATION_TRUCK_STOP);
   663 
   639 
   664 	print("");
   640 	print("");
   665 	print("--StationList--");
   641 	print("--StationList--");
   771 	}
   747 	}
   772 }
   748 }
   773 
   749 
   774 function Regression::Town()
   750 function Regression::Town()
   775 {
   751 {
   776 	local town = AITown();
       
   777 	local j = 0;
   752 	local j = 0;
   778 
   753 
   779 	print("");
   754 	print("");
   780 	print("--Town--");
   755 	print("--Town--");
   781 	print("  GetMaxTownID():    " + town.GetMaxTownID());
   756 	print("  GetMaxTownID():    " + AITown.GetMaxTownID());
   782 	print("  GetTownCount():    " + town.GetTownCount());
   757 	print("  GetTownCount():    " + AITown.GetTownCount());
   783 	for (local i = -1; i < town.GetMaxTownID() + 1; i++) {
   758 	for (local i = -1; i < AITown.GetMaxTownID() + 1; i++) {
   784 		if (town.IsValidTown(i)) j++;
   759 		if (AITown.IsValidTown(i)) j++;
   785 		print("  Town " + i);
   760 		print("  Town " + i);
   786 		print("    IsValidTown():   " + town.IsValidTown(i));
   761 		print("    IsValidTown():   " + AITown.IsValidTown(i));
   787 		print("    GetName():       " + town.GetName(i));
   762 		print("    GetName():       " + AITown.GetName(i));
   788 		print("    GetPopulation(): " + town.GetPopulation(i));
   763 		print("    GetPopulation(): " + AITown.GetPopulation(i));
   789 		print("    GetLocation():   " + town.GetLocation(i));
   764 		print("    GetLocation():   " + AITown.GetLocation(i));
   790 	}
   765 	}
   791 	print("  Valid Towns:       " + j);
   766 	print("  Valid Towns:       " + j);
   792 	print("  GetTownCount():    " + town.GetTownCount());
   767 	print("  GetTownCount():    " + AITown.GetTownCount());
   793 }
   768 }
   794 
   769 
   795 function Regression::TownList()
   770 function Regression::TownList()
   796 {
   771 {
   797 	local list = AITownList();
   772 	local list = AITownList();
   825 }
   800 }
   826 
   801 
   827 function Regression::Vehicle()
   802 function Regression::Vehicle()
   828 {
   803 {
   829 	local accounting = AIAccounting();
   804 	local accounting = AIAccounting();
   830 	local company = AICompany();
       
   831 	local vehicle = AIVehicle();
       
   832 
   805 
   833 	print("");
   806 	print("");
   834 	print("--Vehicle--");
   807 	print("--Vehicle--");
   835 	print("  IsValidVehicle(-1):   " + vehicle.IsValidVehicle(-1));
   808 	print("  IsValidVehicle(-1):   " + AIVehicle.IsValidVehicle(-1));
   836 	print("  IsValidVehicle(0):    " + vehicle.IsValidVehicle(0));
   809 	print("  IsValidVehicle(0):    " + AIVehicle.IsValidVehicle(0));
   837 	print("  IsValidVehicle(11):   " + vehicle.IsValidVehicle(11));
   810 	print("  IsValidVehicle(11):   " + AIVehicle.IsValidVehicle(11));
   838 	print("  ISValidVehicle(9999): " + vehicle.IsValidVehicle(9999));
   811 	print("  ISValidVehicle(9999): " + AIVehicle.IsValidVehicle(9999));
   839 
   812 
   840 	local bank = company.GetBankBalance(AICompany.MY_COMPANY);
   813 	local bank = AICompany.GetBankBalance(AICompany.MY_COMPANY);
   841 
   814 
   842 	{
   815 	{
   843 		local transaction = AITransactionMode();
   816 		local transaction = AITransactionMode();
   844 		print("  BuildVehicle():       " + vehicle.BuildVehicle(33417, 153));
   817 		print("  BuildVehicle():       " + AIVehicle.BuildVehicle(33417, 153));
   845 		print("  IsValidVehicle(11):   " + vehicle.IsValidVehicle(11));
   818 		print("  IsValidVehicle(11):   " + AIVehicle.IsValidVehicle(11));
   846 
   819 
   847 		print("  --Transaction--");
   820 		print("  --Transaction--");
   848 		print("    GetCosts():         " + transaction.GetCosts());
   821 		print("    GetCosts():         " + transaction.GetCosts());
   849 		print("    Execute():          " + transaction.Execute());
   822 		print("    Execute():          " + transaction.Execute());
   850 
   823 
   851 		print("  IsValidVehicle(11):   " + vehicle.IsValidVehicle(11));
   824 		print("  IsValidVehicle(11):   " + AIVehicle.IsValidVehicle(11));
   852 	}
   825 	}
   853 	print("  CloneVehicle():       " + vehicle.CloneVehicle(33417, 11, true));
   826 	print("  CloneVehicle():       " + AIVehicle.CloneVehicle(33417, 11, true));
   854 
   827 
   855 	local bank_after = company.GetBankBalance(AICompany.MY_COMPANY);
   828 	local bank_after = AICompany.GetBankBalance(AICompany.MY_COMPANY);
   856 
   829 
   857 	print("  --Accounting--");
   830 	print("  --Accounting--");
   858 	print("    GetCosts():         " + accounting.GetCosts());
   831 	print("    GetCosts():         " + accounting.GetCosts());
   859 	print("    Should be:          " + (bank - bank_after));
   832 	print("    Should be:          " + (bank - bank_after));
   860 	print("    ResetCosts():       " + accounting.ResetCosts());
   833 	print("    ResetCosts():       " + accounting.ResetCosts());
   861 
   834 
   862 	bank = company.GetBankBalance(AICompany.MY_COMPANY);
   835 	bank = AICompany.GetBankBalance(AICompany.MY_COMPANY);
   863 
   836 
   864 	print("  SellVehicle(12):      " + vehicle.SellVehicle(12));
   837 	print("  SellVehicle(12):      " + AIVehicle.SellVehicle(12));
   865 	print("  IsInDepot():          " + vehicle.IsInDepot(11));
   838 	print("  IsInDepot():          " + AIVehicle.IsInDepot(11));
   866 	print("  IsStoppedInDepot():   " + vehicle.IsStoppedInDepot(11));
   839 	print("  IsStoppedInDepot():   " + AIVehicle.IsStoppedInDepot(11));
   867 	print("  StartStopVehicle():   " + vehicle.StartStopVehicle(11));
   840 	print("  StartStopVehicle():   " + AIVehicle.StartStopVehicle(11));
   868 	print("  IsInDepot():          " + vehicle.IsInDepot(11));
   841 	print("  IsInDepot():          " + AIVehicle.IsInDepot(11));
   869 	print("  IsStoppedInDepot():   " + vehicle.IsStoppedInDepot(11));
   842 	print("  IsStoppedInDepot():   " + AIVehicle.IsStoppedInDepot(11));
   870 	print("  SendVehicleToDepot(): " + vehicle.SendVehicleToDepot(11));
   843 	print("  SendVehicleToDepot(): " + AIVehicle.SendVehicleToDepot(11));
   871 	print("  IsInDepot():          " + vehicle.IsInDepot(11));
   844 	print("  IsInDepot():          " + AIVehicle.IsInDepot(11));
   872 	print("  IsStoppedInDepot():   " + vehicle.IsStoppedInDepot(11));
   845 	print("  IsStoppedInDepot():   " + AIVehicle.IsStoppedInDepot(11));
   873 
   846 
   874 	bank_after = company.GetBankBalance(AICompany.MY_COMPANY);
   847 	bank_after = AICompany.GetBankBalance(AICompany.MY_COMPANY);
   875 
   848 
   876 	print("  --Accounting--");
   849 	print("  --Accounting--");
   877 	print("    GetCosts():         " + accounting.GetCosts());
   850 	print("    GetCosts():         " + accounting.GetCosts());
   878 	print("    Should be:          " + (bank - bank_after));
   851 	print("    Should be:          " + (bank - bank_after));
   879 
   852 
   880 	print("  GetName():            " + vehicle.GetName(11));
   853 	print("  GetName():            " + AIVehicle.GetName(11));
   881 	print("  SetName():            " + vehicle.SetName(11, "MyVehicleName"));
   854 	print("  SetName():            " + AIVehicle.SetName(11, "MyVehicleName"));
   882 	print("  GetName():            " + vehicle.GetName(11));
   855 	print("  GetName():            " + AIVehicle.GetName(11));
   883 	print("  CloneVehicle():       " + vehicle.CloneVehicle(33417, 11, true));
   856 	print("  CloneVehicle():       " + AIVehicle.CloneVehicle(33417, 11, true));
   884 
   857 
   885 	print("  --VehicleData--");
   858 	print("  --VehicleData--");
   886 	print("    GetLocation():       " + vehicle.GetLocation(11));
   859 	print("    GetLocation():       " + AIVehicle.GetLocation(11));
   887 	print("    GetEngineType():     " + vehicle.GetEngineType(11));
   860 	print("    GetEngineType():     " + AIVehicle.GetEngineType(11));
   888 	print("    GetUnitNumber():     " + vehicle.GetUnitNumber(11));
   861 	print("    GetUnitNumber():     " + AIVehicle.GetUnitNumber(11));
   889 	print("    GetAge():            " + vehicle.GetAge(11));
   862 	print("    GetAge():            " + AIVehicle.GetAge(11));
   890 	print("    GetMaxAge():         " + vehicle.GetMaxAge(11));
   863 	print("    GetMaxAge():         " + AIVehicle.GetMaxAge(11));
   891 	print("    GetAgeLeft():        " + vehicle.GetAgeLeft(11));
   864 	print("    GetAgeLeft():        " + AIVehicle.GetAgeLeft(11));
   892 	print("    GetRunningCost():    " + vehicle.GetRunningCost(11));
   865 	print("    GetRunningCost():    " + AIVehicle.GetRunningCost(11));
   893 	print("    GetProfitThisYear(): " + vehicle.GetProfitThisYear(11));
   866 	print("    GetProfitThisYear(): " + AIVehicle.GetProfitThisYear(11));
   894 	print("    GetProfitLastYear(): " + vehicle.GetProfitLastYear(11));
   867 	print("    GetProfitLastYear(): " + AIVehicle.GetProfitLastYear(11));
   895 	print("    GetVehicleType():    " + vehicle.GetVehicleType(11));
   868 	print("    GetVehicleType():    " + AIVehicle.GetVehicleType(11));
   896 	print("    IsInDepot():         " + vehicle.IsInDepot(11));
   869 	print("    IsInDepot():         " + AIVehicle.IsInDepot(11));
   897 	print("    IsStoppedInDepot():  " + vehicle.IsStoppedInDepot(11));
   870 	print("    IsStoppedInDepot():  " + AIVehicle.IsStoppedInDepot(11));
   898 
   871 
   899 	print("  BuildVehicle():       " + vehicle.BuildVehicle(32119, 219));
   872 	print("  BuildVehicle():       " + AIVehicle.BuildVehicle(32119, 219));
   900 	print("  IsValidVehicle(13):   " + vehicle.IsValidVehicle(13));
   873 	print("  IsValidVehicle(13):   " + AIVehicle.IsValidVehicle(13));
   901 	print("  IsInDepot(13):        " + vehicle.IsInDepot(13));
   874 	print("  IsInDepot(13):        " + AIVehicle.IsInDepot(13));
   902 	print("  IsStoppedInDepot(13): " + vehicle.IsStoppedInDepot(13));
   875 	print("  IsStoppedInDepot(13): " + AIVehicle.IsStoppedInDepot(13));
   903 	print("  IsValidVehicle(14):   " + vehicle.IsValidVehicle(14));
   876 	print("  IsValidVehicle(14):   " + AIVehicle.IsValidVehicle(14));
   904 	print("  IsInDepot(14):        " + vehicle.IsInDepot(14));
   877 	print("  IsInDepot(14):        " + AIVehicle.IsInDepot(14));
   905 	print("  IsStoppedInDepot(14): " + vehicle.IsStoppedInDepot(14));
   878 	print("  IsStoppedInDepot(14): " + AIVehicle.IsStoppedInDepot(14));
   906 
   879 
   907 	print("  BuildVehicle():       " + vehicle.BuildVehicle(28479, 204));
   880 	print("  BuildVehicle():       " + AIVehicle.BuildVehicle(28479, 204));
   908 	print("  IsValidVehicle(15):   " + vehicle.IsValidVehicle(15));
   881 	print("  IsValidVehicle(15):   " + AIVehicle.IsValidVehicle(15));
   909 	print("  IsInDepot(15):        " + vehicle.IsInDepot(15));
   882 	print("  IsInDepot(15):        " + AIVehicle.IsInDepot(15));
   910 	print("  IsStoppedInDepot(15): " + vehicle.IsStoppedInDepot(15));
   883 	print("  IsStoppedInDepot(15): " + AIVehicle.IsStoppedInDepot(15));
   911 
   884 
   912 	local list = AIVehicleList();
   885 	local list = AIVehicleList();
   913 
   886 
   914 	print("");
   887 	print("");
   915 	print("--VehicleList--");
   888 	print("--VehicleList--");