author | truebrain |
Thu, 12 Jun 2008 18:03:50 +0000 | |
branch | noai |
changeset 10938 | df6235dd2b7a |
parent 10933 | 57aa2e01942c |
child 10944 | 588393239ac6 |
permissions | -rw-r--r-- |
10899
126faeece8b6
(svn r13450) [NoAI] -Change [API CHANGE]: renamed library category 'sets' to 'queue', as it represents more what the implementations do
truebrain
parents:
10896
diff
changeset
|
1 |
import("queue.priority_queue", "PQ", 2); |
126faeece8b6
(svn r13450) [NoAI] -Change [API CHANGE]: renamed library category 'sets' to 'queue', as it represents more what the implementations do
truebrain
parents:
10896
diff
changeset
|
2 |
import("queue.binary_heap", "BH", 1); |
10918
317f736e5fc6
(svn r13470) [NoAI] -Change [Library CHANGE]: allow in graph.aystar to give a custom param to the callbacks, so you can send in an instance of yourself
truebrain
parents:
10912
diff
changeset
|
3 |
import("graph.aystar", "AS", 3); |
10889
ecb77cfc4a10
(svn r13440) [NoAI] -Add: introducing ai/library, a method to load libraries into your AI.
truebrain
parents:
10871
diff
changeset
|
4 |
|
9460
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
5 |
class Regression extends AIController { |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
6 |
function Start(); |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
7 |
} |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
8 |
|
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
9 |
|
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
10 |
|
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
11 |
function Regression::TestInit() |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
12 |
{ |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
13 |
print(""); |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
14 |
print("--TestInit--"); |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
15 |
print(" TickTest: " + this.GetTick()); |
9557
a3e1a25cf3d3
(svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents:
9555
diff
changeset
|
16 |
this.Sleep(1); |
9460
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
17 |
print(" TickTest: " + this.GetTick()); |
9749
ee414c031e73
(svn r12229) [NoAI] -Fix: AISetting()s functions can be static too
truebrain
parents:
9745
diff
changeset
|
18 |
print(" SetCommandDelay: " + AISettings.SetCommandDelay(1)); |
10852
f02afc46afa8
(svn r13403) [NoAI] -Add: wrapper to read the game settings directly without *any* promises on the results being stable in the future when OpenTTD changes the semantics.
rubidium
parents:
10847
diff
changeset
|
19 |
print(" IsValid(vehicle.plane_speed): " + AIGameSettings.IsValid("vehicle.plane_speed")); |
f02afc46afa8
(svn r13403) [NoAI] -Add: wrapper to read the game settings directly without *any* promises on the results being stable in the future when OpenTTD changes the semantics.
rubidium
parents:
10847
diff
changeset
|
20 |
print(" vehicle.plane_speed: " + AIGameSettings.GetValue("vehicle.plane_speed")); |
10649
9034b80fdbdb
(svn r13193) [NoAI] -Add: allow AIs to be packed in a .tar. one AI per tar, always in a subdir. It looks for main.nut in the first dir it finds in the archive
truebrain
parents:
10383
diff
changeset
|
21 |
require("require.nut"); |
10938
df6235dd2b7a
(svn r13492) [NoAI] -Add: added the 'standard' functions max() and min() in global scope
truebrain
parents:
10933
diff
changeset
|
22 |
print(" min(6, 3): " + min(6, 3)); |
df6235dd2b7a
(svn r13492) [NoAI] -Add: added the 'standard' functions max() and min() in global scope
truebrain
parents:
10933
diff
changeset
|
23 |
print(" min(3, 6): " + min(3, 6)); |
df6235dd2b7a
(svn r13492) [NoAI] -Add: added the 'standard' functions max() and min() in global scope
truebrain
parents:
10933
diff
changeset
|
24 |
print(" max(6, 3): " + max(6, 3)); |
df6235dd2b7a
(svn r13492) [NoAI] -Add: added the 'standard' functions max() and min() in global scope
truebrain
parents:
10933
diff
changeset
|
25 |
print(" max(3, 6): " + max(3, 6)); |
9460
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
26 |
} |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
27 |
|
9487
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
9485
diff
changeset
|
28 |
function Regression::Std() |
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
9485
diff
changeset
|
29 |
{ |
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
9485
diff
changeset
|
30 |
print(""); |
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
9485
diff
changeset
|
31 |
print("--Std--"); |
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
9485
diff
changeset
|
32 |
print(" abs(-21): " + abs(-21)); |
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
9485
diff
changeset
|
33 |
print(" abs( 21): " + abs(21)); |
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
9485
diff
changeset
|
34 |
} |
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
9485
diff
changeset
|
35 |
|
9460
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
36 |
function Regression::Base() |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
37 |
{ |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
38 |
print(""); |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
39 |
print("--AIBase--"); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
40 |
print(" Rand(): " + AIBase.Rand()); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
41 |
print(" Rand(): " + AIBase.Rand()); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
42 |
print(" Rand(): " + AIBase.Rand()); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
43 |
print(" RandRange(0): " + AIBase.RandRange(0)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
44 |
print(" RandRange(0): " + AIBase.RandRange(0)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
45 |
print(" RandRange(0): " + AIBase.RandRange(0)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
46 |
print(" RandRange(1): " + AIBase.RandRange(1)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
47 |
print(" RandRange(1): " + AIBase.RandRange(1)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
48 |
print(" RandRange(1): " + AIBase.RandRange(1)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
49 |
print(" RandRange(2): " + AIBase.RandRange(2)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
50 |
print(" RandRange(2): " + AIBase.RandRange(2)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
51 |
print(" RandRange(2): " + AIBase.RandRange(2)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
52 |
print(" RandRange(9): " + AIBase.RandRange(9)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
53 |
print(" RandRange(9): " + AIBase.RandRange(9)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
54 |
print(" RandRange(9): " + AIBase.RandRange(9)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
55 |
print(" Chance(1, 2): " + AIBase.Chance(1, 2)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
56 |
print(" Chance(1, 2): " + AIBase.Chance(1, 2)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
57 |
print(" Chance(1, 2): " + AIBase.Chance(1, 2)); |
9460
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
58 |
} |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
59 |
|
9654
b836eb5c521f
(svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
9652
diff
changeset
|
60 |
function Regression::Airport() |
b836eb5c521f
(svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
9652
diff
changeset
|
61 |
{ |
b836eb5c521f
(svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
9652
diff
changeset
|
62 |
print(""); |
b836eb5c521f
(svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
9652
diff
changeset
|
63 |
print("--AIAirport--"); |
b836eb5c521f
(svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
9652
diff
changeset
|
64 |
|
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
65 |
print(" IsHangarTile(): " + AIAirport.IsHangarTile(32116)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
66 |
print(" IsAirportTile(): " + AIAirport.IsAirportTile(32116)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
67 |
print(" GetHangarOfAirport(): " + AIAirport.GetHangarOfAirport(32116)); |
9654
b836eb5c521f
(svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
9652
diff
changeset
|
68 |
|
b836eb5c521f
(svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
9652
diff
changeset
|
69 |
for (local i = -1; i < 10; i++) { |
9773
d2c20cd38f18
(svn r12266) [NoAI] -Fix: [API CHANGE] minor typo in Ai*r*portAvailable (tnx yorick)
truebrain
parents:
9771
diff
changeset
|
70 |
print(" AirportAvailable(" + i + "): " + AIAirport.AirportAvailable(i)); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
71 |
print(" GetAirportWidth(" + i + "): " + AIAirport.GetAirportWidth(i)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
72 |
print(" GetAirportHeight(" + i + "): " + AIAirport.GetAirportHeight(i)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
73 |
print(" GetAirportCoverageRadius(" + i + "): " + AIAirport.GetAirportCoverageRadius(i)); |
9654
b836eb5c521f
(svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
9652
diff
changeset
|
74 |
} |
b836eb5c521f
(svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
9652
diff
changeset
|
75 |
|
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
76 |
print(" GetBankBalance(): " + AICompany.GetBankBalance(AICompany.MY_COMPANY)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
77 |
print(" BuildAirport(): " + AIAirport.BuildAirport(32116, 0)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
78 |
print(" IsHangarTile(): " + AIAirport.IsHangarTile(32116)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
79 |
print(" IsAirportTile(): " + AIAirport.IsAirportTile(32116)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
80 |
print(" GetHangarOfAirport(): " + AIAirport.GetHangarOfAirport(32116)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
81 |
print(" IsHangarTile(): " + AIAirport.IsHangarTile(32119)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
82 |
print(" IsAirportTile(): " + AIAirport.IsAirportTile(32119)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
83 |
print(" GetBankBalance(): " + AICompany.GetBankBalance(AICompany.MY_COMPANY)); |
9654
b836eb5c521f
(svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
9652
diff
changeset
|
84 |
|
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
85 |
print(" RemoveAirport(): " + AIAirport.RemoveAirport(32118)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
86 |
print(" IsHangarTile(): " + AIAirport.IsHangarTile(32119)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
87 |
print(" IsAirportTile(): " + AIAirport.IsAirportTile(32119)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
88 |
print(" GetBankBalance(): " + AICompany.GetBankBalance(AICompany.MY_COMPANY)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
89 |
print(" BuildAirport(): " + AIAirport.BuildAirport(32116, 0)); |
9654
b836eb5c521f
(svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
9652
diff
changeset
|
90 |
} |
b836eb5c521f
(svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
9652
diff
changeset
|
91 |
|
9792
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
92 |
function Regression::Bridge() |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
93 |
{ |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
94 |
local j = 0; |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
95 |
|
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
96 |
print(""); |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
97 |
print("--Bridge--"); |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
98 |
for (local i = -1; i < 14; i++) { |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
99 |
if (AIBridge.IsValidBridge(i)) j++; |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
100 |
print(" Bridge " + i); |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
101 |
print(" IsValidBridge(): " + AIBridge.IsValidBridge(i)); |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
102 |
print(" GetName(): " + AIBridge.GetName(i)); |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
103 |
print(" GetMaxSpeed(): " + AIBridge.GetMaxSpeed(i)); |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
104 |
print(" GetPrice(): " + AIBridge.GetPrice(i, 5)); |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
105 |
print(" GetMaxLength(): " + AIBridge.GetMaxLength(i)); |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
106 |
print(" GetMinLength(): " + AIBridge.GetMinLength(i)); |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
107 |
print(" GetYearAvailable(): " + AIBridge.GetYearAvailable(i)); |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
108 |
} |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
109 |
print(" Valid Bridges: " + j); |
9793
c5fb53240401
(svn r12297) [NoAI] -Add: added AIBridge.BuildBridge and friends
truebrain
parents:
9792
diff
changeset
|
110 |
|
c5fb53240401
(svn r12297) [NoAI] -Add: added AIBridge.BuildBridge and friends
truebrain
parents:
9792
diff
changeset
|
111 |
print(" IsBridgeTile(): " + AIBridge.IsBridgeTile(33160)); |
c5fb53240401
(svn r12297) [NoAI] -Add: added AIBridge.BuildBridge and friends
truebrain
parents:
9792
diff
changeset
|
112 |
print(" RemoveBridge(): " + AIBridge.RemoveBridge(33155)); |
9867
b7d9ffe24f81
(svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents:
9865
diff
changeset
|
113 |
print(" GetLastErrorString(): " + AIError.GetLastErrorString()); |
10691
a60393d87c0b
(svn r13235) [NoAI] -Change [API CHANGE]: AITunnel.GetOtherTunnelEnd() now returns INVALID_TILE if no other end is found
glx
parents:
10675
diff
changeset
|
114 |
print(" GetOtherBridgeEnd(): " + AIBridge.GetOtherBridgeEnd(33160)); |
9793
c5fb53240401
(svn r12297) [NoAI] -Add: added AIBridge.BuildBridge and friends
truebrain
parents:
9792
diff
changeset
|
115 |
print(" BuildBridge(): " + AIBridge.BuildBridge(AIVehicle.VEHICLE_ROAD, 5, 33160, 33155)); |
c5fb53240401
(svn r12297) [NoAI] -Add: added AIBridge.BuildBridge and friends
truebrain
parents:
9792
diff
changeset
|
116 |
print(" IsBridgeTile(): " + AIBridge.IsBridgeTile(33160)); |
c5fb53240401
(svn r12297) [NoAI] -Add: added AIBridge.BuildBridge and friends
truebrain
parents:
9792
diff
changeset
|
117 |
print(" IsBridgeTile(): " + AIBridge.IsBridgeTile(33155)); |
10691
a60393d87c0b
(svn r13235) [NoAI] -Change [API CHANGE]: AITunnel.GetOtherTunnelEnd() now returns INVALID_TILE if no other end is found
glx
parents:
10675
diff
changeset
|
118 |
print(" GetOtherBridgeEnd(): " + AIBridge.GetOtherBridgeEnd(33160)); |
9867
b7d9ffe24f81
(svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents:
9865
diff
changeset
|
119 |
print(" BuildBridge(): " + AIBridge.BuildBridge(AIVehicle.VEHICLE_ROAD, 5, 33160, 33155)); |
b7d9ffe24f81
(svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents:
9865
diff
changeset
|
120 |
print(" GetLastErrorString(): " + AIError.GetLastErrorString()); |
9793
c5fb53240401
(svn r12297) [NoAI] -Add: added AIBridge.BuildBridge and friends
truebrain
parents:
9792
diff
changeset
|
121 |
print(" RemoveBridge(): " + AIBridge.RemoveBridge(33155)); |
c5fb53240401
(svn r12297) [NoAI] -Add: added AIBridge.BuildBridge and friends
truebrain
parents:
9792
diff
changeset
|
122 |
print(" IsBridgeTile(): " + AIBridge.IsBridgeTile(33160)); |
9792
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
123 |
} |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
124 |
|
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
125 |
function Regression::BridgeList() |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
126 |
{ |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
127 |
local list = AIBridgeList(); |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
128 |
|
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
129 |
print(""); |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
130 |
print("--BridgeList--"); |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
131 |
print(" Count(): " + list.Count()); |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
132 |
list.Valuate(AIBridge.GetMaxSpeed); |
9792
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
133 |
print(" MaxSpeed ListDump:"); |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
134 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
135 |
print(" " + i + " => " + list.GetValue(i)); |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
136 |
} |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
137 |
list.Valuate(AIBridge.GetPrice, 5); |
9792
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
138 |
print(" Price ListDump:"); |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
139 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
140 |
print(" " + i + " => " + list.GetValue(i)); |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
141 |
} |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
142 |
list.Valuate(AIBridge.GetMaxLength); |
9792
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
143 |
print(" MaxLength ListDump:"); |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
144 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
145 |
print(" " + i + " => " + list.GetValue(i)); |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
146 |
} |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
147 |
list.Valuate(AIBridge.GetMinLength); |
9792
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
148 |
print(" MinLength ListDump:"); |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
149 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
150 |
print(" " + i + " => " + list.GetValue(i)); |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
151 |
} |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
152 |
list.Valuate(AIBridge.GetYearAvailable); |
9792
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
153 |
print(" YearAvailable ListDump:"); |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
154 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
155 |
print(" " + i + " => " + list.GetValue(i)); |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
156 |
} |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
157 |
|
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
158 |
local list = AIBridgeList_Length(14); |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
159 |
|
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
160 |
print(""); |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
161 |
print("--BridgeList_Length--"); |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
162 |
print(" Count(): " + list.Count()); |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
163 |
list.Valuate(AIBridge.GetMaxSpeed); |
9792
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
164 |
print(" MaxSpeed ListDump:"); |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
165 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
166 |
print(" " + i + " => " + list.GetValue(i)); |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
167 |
} |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
168 |
list.Valuate(AIBridge.GetPrice, 14); |
9792
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
169 |
print(" Price ListDump:"); |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
170 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
171 |
print(" " + i + " => " + list.GetValue(i)); |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
172 |
} |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
173 |
} |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
174 |
|
9460
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
175 |
function Regression::Cargo() |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
176 |
{ |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
177 |
print(""); |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
178 |
print("--AICargo--"); |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
179 |
for (local i = -1; i < 15; i++) { |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
180 |
print(" Cargo " + i); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
181 |
print(" IsValidCargo(): " + AICargo.IsValidCargo(i)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
182 |
print(" GetCargoLabel(): '" + AICargo.GetCargoLabel(i)+ "'"); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
183 |
print(" IsFreight(): " + AICargo.IsFreight(i)); |
10675
b16fdb811ebb
(svn r13219) [NoAI] -Add: added AICargo.HasCargoClass(), which allows you to find, say, passenger-based cargo (tnx kuifware for the pointer!)
truebrain
parents:
10668
diff
changeset
|
184 |
print(" HasCargoClass(): " + AICargo.HasCargoClass(i, AICargo.CC_PASSENGERS)); |
10831
f7e17819358b
(svn r13382) [NoAI] -Add: added AICargo::GetTownEffect()
truebrain
parents:
10776
diff
changeset
|
185 |
print(" GetTownEffect(): " + AICargo.GetTownEffect(i)); |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
186 |
print(" GetCargoIncome(0, 0): " + AICargo.GetCargoIncome(i, 0, 0)); |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
187 |
print(" GetCargoIncome(10, 10): " + AICargo.GetCargoIncome(i, 10, 10)); |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
188 |
print(" GetCargoIncome(100, 10): " + AICargo.GetCargoIncome(i, 100, 10)); |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
189 |
print(" GetCargoIncome(10, 100): " + AICargo.GetCargoIncome(i, 10, 100)); |
9460
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
190 |
} |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
191 |
} |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
192 |
|
9785
edbd185e05ed
(svn r12280) [NoAI] -Add: added AICargoList (Morloth)
truebrain
parents:
9776
diff
changeset
|
193 |
function Regression::CargoList() |
edbd185e05ed
(svn r12280) [NoAI] -Add: added AICargoList (Morloth)
truebrain
parents:
9776
diff
changeset
|
194 |
{ |
edbd185e05ed
(svn r12280) [NoAI] -Add: added AICargoList (Morloth)
truebrain
parents:
9776
diff
changeset
|
195 |
local list = AICargoList(); |
edbd185e05ed
(svn r12280) [NoAI] -Add: added AICargoList (Morloth)
truebrain
parents:
9776
diff
changeset
|
196 |
|
edbd185e05ed
(svn r12280) [NoAI] -Add: added AICargoList (Morloth)
truebrain
parents:
9776
diff
changeset
|
197 |
print(""); |
edbd185e05ed
(svn r12280) [NoAI] -Add: added AICargoList (Morloth)
truebrain
parents:
9776
diff
changeset
|
198 |
print("--CargoList--"); |
edbd185e05ed
(svn r12280) [NoAI] -Add: added AICargoList (Morloth)
truebrain
parents:
9776
diff
changeset
|
199 |
print(" Count(): " + list.Count()); |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
200 |
list.Valuate(AICargo.IsFreight); |
9788
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
9785
diff
changeset
|
201 |
print(" IsFreight ListDump:"); |
9785
edbd185e05ed
(svn r12280) [NoAI] -Add: added AICargoList (Morloth)
truebrain
parents:
9776
diff
changeset
|
202 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
9788
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
9785
diff
changeset
|
203 |
print(" " + i + " => " + list.GetValue(i)); |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
9785
diff
changeset
|
204 |
} |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
9785
diff
changeset
|
205 |
|
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
206 |
list.Valuate(AICargo.GetCargoIncome, 100, 100); |
9788
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
9785
diff
changeset
|
207 |
print(" CargoIncomes(100, 100) ListDump:"); |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
9785
diff
changeset
|
208 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
9785
diff
changeset
|
209 |
print(" " + i + " => " + list.GetValue(i)); |
9785
edbd185e05ed
(svn r12280) [NoAI] -Add: added AICargoList (Morloth)
truebrain
parents:
9776
diff
changeset
|
210 |
} |
edbd185e05ed
(svn r12280) [NoAI] -Add: added AICargoList (Morloth)
truebrain
parents:
9776
diff
changeset
|
211 |
} |
edbd185e05ed
(svn r12280) [NoAI] -Add: added AICargoList (Morloth)
truebrain
parents:
9776
diff
changeset
|
212 |
|
9460
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
213 |
function Regression::Company() |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
214 |
{ |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
215 |
print(""); |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
216 |
print("--Company--"); |
9558
4fc9b464a932
(svn r9496) [NoAI] -Add: added regression for AITestMode() and AIExecMode()
truelight
parents:
9557
diff
changeset
|
217 |
|
4fc9b464a932
(svn r9496) [NoAI] -Add: added regression for AITestMode() and AIExecMode()
truelight
parents:
9557
diff
changeset
|
218 |
/* Test AIXXXMode() in scopes */ |
4fc9b464a932
(svn r9496) [NoAI] -Add: added regression for AITestMode() and AIExecMode()
truelight
parents:
9557
diff
changeset
|
219 |
{ |
4fc9b464a932
(svn r9496) [NoAI] -Add: added regression for AITestMode() and AIExecMode()
truelight
parents:
9557
diff
changeset
|
220 |
local test = AITestMode(); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
221 |
print(" SetCompanyName(): " + AICompany.SetCompanyName("Regression")); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
222 |
print(" SetCompanyName(): " + AICompany.SetCompanyName("Regression")); |
9558
4fc9b464a932
(svn r9496) [NoAI] -Add: added regression for AITestMode() and AIExecMode()
truelight
parents:
9557
diff
changeset
|
223 |
{ |
4fc9b464a932
(svn r9496) [NoAI] -Add: added regression for AITestMode() and AIExecMode()
truelight
parents:
9557
diff
changeset
|
224 |
local exec = AIExecMode(); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
225 |
print(" SetCompanyName(): " + AICompany.SetCompanyName("Regression")); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
226 |
print(" SetCompanyName(): " + AICompany.SetCompanyName("Regression")); |
9865
f241472f09dc
(svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents:
9844
diff
changeset
|
227 |
print(" GetLastErrorString(): " + AIError.GetLastErrorString()); |
9558
4fc9b464a932
(svn r9496) [NoAI] -Add: added regression for AITestMode() and AIExecMode()
truelight
parents:
9557
diff
changeset
|
228 |
} |
4fc9b464a932
(svn r9496) [NoAI] -Add: added regression for AITestMode() and AIExecMode()
truelight
parents:
9557
diff
changeset
|
229 |
} |
4fc9b464a932
(svn r9496) [NoAI] -Add: added regression for AITestMode() and AIExecMode()
truelight
parents:
9557
diff
changeset
|
230 |
|
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
231 |
print(" GetCompanyName(): " + AICompany.GetCompanyName(AICompany.MY_COMPANY)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
232 |
print(" GetPresidentName(): " + AICompany.GetPresidentName(AICompany.MY_COMPANY)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
233 |
print(" SetPresidentName(): " + AICompany.SetPresidentName("Regression AI")); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
234 |
print(" GetPresidentName(): " + AICompany.GetPresidentName(AICompany.MY_COMPANY)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
235 |
print(" GetCompanyValue(): " + AICompany.GetCompanyValue(AICompany.MY_COMPANY)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
236 |
print(" GetBankBalance(): " + AICompany.GetBankBalance(AICompany.MY_COMPANY)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
237 |
print(" GetCompanyName(): " + AICompany.GetCompanyName(240)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
238 |
print(" GetLoanAmount(): " + AICompany.GetLoanAmount()); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
239 |
print(" GetMaxLoanAmount(): " + AICompany.GetMaxLoanAmount()); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
240 |
print(" GetLoanInterval(): " + AICompany.GetLoanInterval()); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
241 |
print(" SetLoanAmount(1): " + AICompany.SetLoanAmount(1)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
242 |
print(" SetLoanAmount(100): " + AICompany.SetLoanAmount(100)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
243 |
print(" SetLoanAmount(10000): " + AICompany.SetLoanAmount(10000)); |
9865
f241472f09dc
(svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents:
9844
diff
changeset
|
244 |
print(" GetLastErrorString(): " + AIError.GetLastErrorString()); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
245 |
print(" GetBankBalance(): " + AICompany.GetBankBalance(AICompany.MY_COMPANY)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
246 |
print(" GetLoanAmount(): " + AICompany.GetLoanAmount()); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
247 |
print(" SetMinimumLoanAmount(31337): " + AICompany.SetMinimumLoanAmount(31337)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
248 |
print(" GetBankBalance(): " + AICompany.GetBankBalance(AICompany.MY_COMPANY)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
249 |
print(" GetLoanAmount(): " + AICompany.GetLoanAmount()); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
250 |
print(" SetLoanAmount(10000): " + AICompany.SetLoanAmount(AICompany.GetMaxLoanAmount())); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
251 |
print(" GetBankBalance(): " + AICompany.GetBankBalance(AICompany.MY_COMPANY)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
252 |
print(" GetLoanAmount(): " + AICompany.GetLoanAmount()); |
9808
0b40f556e051
(svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents:
9807
diff
changeset
|
253 |
print(" GetCompanyHQ(): " + AICompany.GetCompanyHQ(AICompany.MY_COMPANY)); |
0b40f556e051
(svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents:
9807
diff
changeset
|
254 |
print(" BuildCompanyHQ(): " + AICompany.BuildCompanyHQ(AIMap.GetTileIndex(127, 129))); |
0b40f556e051
(svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents:
9807
diff
changeset
|
255 |
print(" GetCompanyHQ(): " + AICompany.GetCompanyHQ(AICompany.MY_COMPANY)); |
0b40f556e051
(svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents:
9807
diff
changeset
|
256 |
print(" BuildCompanyHQ(): " + AICompany.BuildCompanyHQ(AIMap.GetTileIndex(129, 129))); |
0b40f556e051
(svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents:
9807
diff
changeset
|
257 |
print(" GetCompanyHQ(): " + AICompany.GetCompanyHQ(AICompany.MY_COMPANY)); |
9865
f241472f09dc
(svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents:
9844
diff
changeset
|
258 |
print(" BuildCompanyHQ(): " + AICompany.BuildCompanyHQ(AIMap.GetTileIndex(129, 128))); |
f241472f09dc
(svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents:
9844
diff
changeset
|
259 |
print(" GetLastErrorString(): " + AIError.GetLastErrorString()); |
10291
11cb78922367
(svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents:
10193
diff
changeset
|
260 |
print(" GetAutoRenewStatus(); " + AICompany.GetAutoRenewStatus(AICompany.MY_COMPANY)); |
11cb78922367
(svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents:
10193
diff
changeset
|
261 |
print(" SetAutoRenewStatus(true); " + AICompany.SetAutoRenewStatus(true)); |
11cb78922367
(svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents:
10193
diff
changeset
|
262 |
print(" GetAutoRenewStatus(); " + AICompany.GetAutoRenewStatus(AICompany.MY_COMPANY)); |
11cb78922367
(svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents:
10193
diff
changeset
|
263 |
print(" SetAutoRenewStatus(true); " + AICompany.SetAutoRenewStatus(true)); |
11cb78922367
(svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents:
10193
diff
changeset
|
264 |
print(" SetAutoRenewStatus(false); " + AICompany.SetAutoRenewStatus(false)); |
11cb78922367
(svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents:
10193
diff
changeset
|
265 |
print(" GetAutoRenewMonths(); " + AICompany.GetAutoRenewMonths(AICompany.MY_COMPANY)); |
11cb78922367
(svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents:
10193
diff
changeset
|
266 |
print(" SetAutoRenewMonths(-12); " + AICompany.SetAutoRenewMonths(-12)); |
11cb78922367
(svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents:
10193
diff
changeset
|
267 |
print(" GetAutoRenewMonths(); " + AICompany.GetAutoRenewMonths(AICompany.MY_COMPANY)); |
11cb78922367
(svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents:
10193
diff
changeset
|
268 |
print(" SetAutoRenewMonths(-12); " + AICompany.SetAutoRenewMonths(-12)); |
11cb78922367
(svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents:
10193
diff
changeset
|
269 |
print(" SetAutoRenewMonths(6); " + AICompany.SetAutoRenewMonths(6)); |
11cb78922367
(svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents:
10193
diff
changeset
|
270 |
print(" GetAutoRenewMoney(); " + AICompany.GetAutoRenewMoney(AICompany.MY_COMPANY)); |
11cb78922367
(svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents:
10193
diff
changeset
|
271 |
print(" SetAutoRenewMoney(200000); " + AICompany.SetAutoRenewMoney(200000)); |
11cb78922367
(svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents:
10193
diff
changeset
|
272 |
print(" GetAutoRenewMoney(); " + AICompany.GetAutoRenewMoney(AICompany.MY_COMPANY)); |
11cb78922367
(svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents:
10193
diff
changeset
|
273 |
print(" SetAutoRenewMoney(200000); " + AICompany.SetAutoRenewMoney(200000)); |
11cb78922367
(svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents:
10193
diff
changeset
|
274 |
print(" SetAutoRenewMoney(100000); " + AICompany.SetAutoRenewMoney(100000)); |
9460
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
275 |
} |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
276 |
|
9711
c8b427215c9d
(svn r11295) [NoAI] -Change [API CHANGE]: put Engine things in AIEngine, and rename functions as such. Most noticable: FindBestXXXVehicle -> FineBestXXXEngine
truelight
parents:
9710
diff
changeset
|
277 |
function Regression::Engine() |
c8b427215c9d
(svn r11295) [NoAI] -Change [API CHANGE]: put Engine things in AIEngine, and rename functions as such. Most noticable: FindBestXXXVehicle -> FineBestXXXEngine
truelight
parents:
9710
diff
changeset
|
278 |
{ |
c8b427215c9d
(svn r11295) [NoAI] -Change [API CHANGE]: put Engine things in AIEngine, and rename functions as such. Most noticable: FindBestXXXVehicle -> FineBestXXXEngine
truelight
parents:
9710
diff
changeset
|
279 |
local j = 0; |
c8b427215c9d
(svn r11295) [NoAI] -Change [API CHANGE]: put Engine things in AIEngine, and rename functions as such. Most noticable: FindBestXXXVehicle -> FineBestXXXEngine
truelight
parents:
9710
diff
changeset
|
280 |
|
c8b427215c9d
(svn r11295) [NoAI] -Change [API CHANGE]: put Engine things in AIEngine, and rename functions as such. Most noticable: FindBestXXXVehicle -> FineBestXXXEngine
truelight
parents:
9710
diff
changeset
|
281 |
print(""); |
c8b427215c9d
(svn r11295) [NoAI] -Change [API CHANGE]: put Engine things in AIEngine, and rename functions as such. Most noticable: FindBestXXXVehicle -> FineBestXXXEngine
truelight
parents:
9710
diff
changeset
|
282 |
print("--Engine--"); |
c8b427215c9d
(svn r11295) [NoAI] -Change [API CHANGE]: put Engine things in AIEngine, and rename functions as such. Most noticable: FindBestXXXVehicle -> FineBestXXXEngine
truelight
parents:
9710
diff
changeset
|
283 |
for (local i = -1; i < 257; i++) { |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
284 |
if (AIEngine.IsValidEngine(i)) j++; |
9711
c8b427215c9d
(svn r11295) [NoAI] -Change [API CHANGE]: put Engine things in AIEngine, and rename functions as such. Most noticable: FindBestXXXVehicle -> FineBestXXXEngine
truelight
parents:
9710
diff
changeset
|
285 |
print(" Engine " + i); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
286 |
print(" IsValidEngine(): " + AIEngine.IsValidEngine(i)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
287 |
print(" GetName(): " + AIEngine.GetName(i)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
288 |
print(" GetCargoType(): " + AIEngine.GetCargoType(i)); |
9809
9b21c21052fa
(svn r12325) [NoAI] -Add: added AIEngine:CanRefitCargo()
truebrain
parents:
9808
diff
changeset
|
289 |
print(" CanRefitCargo(): " + AIEngine.CanRefitCargo(i, 1)); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
290 |
print(" GetCapacity(): " + AIEngine.GetCapacity(i)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
291 |
print(" GetReliability(): " + AIEngine.GetReliability(i)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
292 |
print(" GetMaxSpeed(): " + AIEngine.GetMaxSpeed(i)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
293 |
print(" GetPrice(): " + AIEngine.GetPrice(i)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
294 |
print(" GetMaxAge(): " + AIEngine.GetMaxAge(i)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
295 |
print(" GetRunningCost(): " + AIEngine.GetRunningCost(i)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
296 |
print(" GetVehicleType(): " + AIEngine.GetVehicleType(i)); |
10668
495789401303
(svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents:
10650
diff
changeset
|
297 |
print(" GetRoadType(): " + AIEngine.GetRoadType(i)); |
9711
c8b427215c9d
(svn r11295) [NoAI] -Change [API CHANGE]: put Engine things in AIEngine, and rename functions as such. Most noticable: FindBestXXXVehicle -> FineBestXXXEngine
truelight
parents:
9710
diff
changeset
|
298 |
} |
c8b427215c9d
(svn r11295) [NoAI] -Change [API CHANGE]: put Engine things in AIEngine, and rename functions as such. Most noticable: FindBestXXXVehicle -> FineBestXXXEngine
truelight
parents:
9710
diff
changeset
|
299 |
print(" Valid Engines: " + j); |
c8b427215c9d
(svn r11295) [NoAI] -Change [API CHANGE]: put Engine things in AIEngine, and rename functions as such. Most noticable: FindBestXXXVehicle -> FineBestXXXEngine
truelight
parents:
9710
diff
changeset
|
300 |
} |
c8b427215c9d
(svn r11295) [NoAI] -Change [API CHANGE]: put Engine things in AIEngine, and rename functions as such. Most noticable: FindBestXXXVehicle -> FineBestXXXEngine
truelight
parents:
9710
diff
changeset
|
301 |
|
9714
fdbdae7ea647
(svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents:
9713
diff
changeset
|
302 |
function Regression::EngineList() |
fdbdae7ea647
(svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents:
9713
diff
changeset
|
303 |
{ |
fdbdae7ea647
(svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents:
9713
diff
changeset
|
304 |
local list = AIEngineList(AIVehicle.VEHICLE_ROAD); |
fdbdae7ea647
(svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents:
9713
diff
changeset
|
305 |
|
fdbdae7ea647
(svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents:
9713
diff
changeset
|
306 |
print(""); |
fdbdae7ea647
(svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents:
9713
diff
changeset
|
307 |
print("--EngineList--"); |
fdbdae7ea647
(svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents:
9713
diff
changeset
|
308 |
print(" Count(): " + list.Count()); |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
309 |
list.Valuate(AIEngine.GetCargoType); |
9714
fdbdae7ea647
(svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents:
9713
diff
changeset
|
310 |
print(" CargoType ListDump:"); |
fdbdae7ea647
(svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents:
9713
diff
changeset
|
311 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
fdbdae7ea647
(svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents:
9713
diff
changeset
|
312 |
print(" " + i + " => " + list.GetValue(i)); |
fdbdae7ea647
(svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents:
9713
diff
changeset
|
313 |
} |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
314 |
list.Valuate(AIEngine.GetCapacity); |
9714
fdbdae7ea647
(svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents:
9713
diff
changeset
|
315 |
print(" Capacity ListDump:"); |
fdbdae7ea647
(svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents:
9713
diff
changeset
|
316 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
fdbdae7ea647
(svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents:
9713
diff
changeset
|
317 |
print(" " + i + " => " + list.GetValue(i)); |
fdbdae7ea647
(svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents:
9713
diff
changeset
|
318 |
} |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
319 |
list.Valuate(AIEngine.GetReliability); |
9714
fdbdae7ea647
(svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents:
9713
diff
changeset
|
320 |
print(" Reliability ListDump:"); |
fdbdae7ea647
(svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents:
9713
diff
changeset
|
321 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
fdbdae7ea647
(svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents:
9713
diff
changeset
|
322 |
print(" " + i + " => " + list.GetValue(i)); |
fdbdae7ea647
(svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents:
9713
diff
changeset
|
323 |
} |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
324 |
list.Valuate(AIEngine.GetMaxSpeed); |
9714
fdbdae7ea647
(svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents:
9713
diff
changeset
|
325 |
print(" MaxSpeed ListDump:"); |
fdbdae7ea647
(svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents:
9713
diff
changeset
|
326 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
fdbdae7ea647
(svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents:
9713
diff
changeset
|
327 |
print(" " + i + " => " + list.GetValue(i)); |
fdbdae7ea647
(svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents:
9713
diff
changeset
|
328 |
} |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
329 |
list.Valuate(AIEngine.GetPrice); |
9714
fdbdae7ea647
(svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents:
9713
diff
changeset
|
330 |
print(" Price ListDump:"); |
fdbdae7ea647
(svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents:
9713
diff
changeset
|
331 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
fdbdae7ea647
(svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents:
9713
diff
changeset
|
332 |
print(" " + i + " => " + list.GetValue(i)); |
fdbdae7ea647
(svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents:
9713
diff
changeset
|
333 |
} |
fdbdae7ea647
(svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents:
9713
diff
changeset
|
334 |
} |
fdbdae7ea647
(svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents:
9713
diff
changeset
|
335 |
|
9682
d031eb183733
(svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents:
9672
diff
changeset
|
336 |
function Regression::Event() |
d031eb183733
(svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents:
9672
diff
changeset
|
337 |
{ |
d031eb183733
(svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents:
9672
diff
changeset
|
338 |
print(""); |
d031eb183733
(svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents:
9672
diff
changeset
|
339 |
print("--Event--"); |
d031eb183733
(svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents:
9672
diff
changeset
|
340 |
AIEventController.Test(); |
d031eb183733
(svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents:
9672
diff
changeset
|
341 |
local e = AIEventController.GetNextEvent(); |
9684
623970482fb2
(svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents:
9682
diff
changeset
|
342 |
print(" GetNextEvent: " + (e == null ? "null" : "instance")); |
9682
d031eb183733
(svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents:
9672
diff
changeset
|
343 |
print(" GetEventType: " + e.GetEventType()); |
d031eb183733
(svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents:
9672
diff
changeset
|
344 |
local c = AIEventTest.Convert(e); |
9684
623970482fb2
(svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents:
9682
diff
changeset
|
345 |
print(" Convert: " + (c == null ? "null" : "instance")); |
9682
d031eb183733
(svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents:
9672
diff
changeset
|
346 |
print(" GetTest: " + c.GetTest()); |
d031eb183733
(svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents:
9672
diff
changeset
|
347 |
|
d031eb183733
(svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents:
9672
diff
changeset
|
348 |
print(" DisableEvent(1): done"); |
d031eb183733
(svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents:
9672
diff
changeset
|
349 |
AIEventController.DisableEvent(1); |
d031eb183733
(svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents:
9672
diff
changeset
|
350 |
AIEventController.Test(); |
d031eb183733
(svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents:
9672
diff
changeset
|
351 |
e = AIEventController.GetNextEvent(); |
9684
623970482fb2
(svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents:
9682
diff
changeset
|
352 |
print(" GetNextEvent: " + (e == null ? "null" : "instance")); |
9682
d031eb183733
(svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents:
9672
diff
changeset
|
353 |
|
d031eb183733
(svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents:
9672
diff
changeset
|
354 |
print(" EnableEvent(1): done"); |
d031eb183733
(svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents:
9672
diff
changeset
|
355 |
AIEventController.EnableEvent(1); |
d031eb183733
(svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents:
9672
diff
changeset
|
356 |
AIEventController.Test(); |
d031eb183733
(svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents:
9672
diff
changeset
|
357 |
e = AIEventController.GetNextEvent(); |
9684
623970482fb2
(svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents:
9682
diff
changeset
|
358 |
print(" GetNextEvent: " + (e == null ? "null" : "instance")); |
9682
d031eb183733
(svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents:
9672
diff
changeset
|
359 |
|
d031eb183733
(svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents:
9672
diff
changeset
|
360 |
{ |
d031eb183733
(svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents:
9672
diff
changeset
|
361 |
print(" DisableAllEvents():done"); |
d031eb183733
(svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents:
9672
diff
changeset
|
362 |
AIEventController.DisableAllEvents(); |
d031eb183733
(svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents:
9672
diff
changeset
|
363 |
AIEventController.Test(); |
d031eb183733
(svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents:
9672
diff
changeset
|
364 |
e = AIEventController.GetNextEvent(); |
9684
623970482fb2
(svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents:
9682
diff
changeset
|
365 |
print(" GetNextEvent: " + (e == null ? "null" : "instance")); |
9682
d031eb183733
(svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents:
9672
diff
changeset
|
366 |
} |
d031eb183733
(svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents:
9672
diff
changeset
|
367 |
|
d031eb183733
(svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents:
9672
diff
changeset
|
368 |
print(" EnableEvent(1): done"); |
d031eb183733
(svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents:
9672
diff
changeset
|
369 |
AIEventController.EnableEvent(1); |
d031eb183733
(svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents:
9672
diff
changeset
|
370 |
AIEventController.Test(); |
d031eb183733
(svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents:
9672
diff
changeset
|
371 |
e = AIEventController.GetNextEvent(); |
9684
623970482fb2
(svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents:
9682
diff
changeset
|
372 |
print(" GetNextEvent: " + (e == null ? "null" : "instance")); |
623970482fb2
(svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents:
9682
diff
changeset
|
373 |
e = AIEventController.GetNextEvent(); |
623970482fb2
(svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents:
9682
diff
changeset
|
374 |
print(" GetNextEvent: " + (e == null ? "null" : "instance")); |
9823
0b7f816cf46f
(svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents:
9814
diff
changeset
|
375 |
|
0b7f816cf46f
(svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents:
9814
diff
changeset
|
376 |
AIEventController.EnableAllEvents(); |
9682
d031eb183733
(svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents:
9672
diff
changeset
|
377 |
} |
d031eb183733
(svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents:
9672
diff
changeset
|
378 |
|
10918
317f736e5fc6
(svn r13470) [NoAI] -Change [Library CHANGE]: allow in graph.aystar to give a custom param to the callbacks, so you can send in an instance of yourself
truebrain
parents:
10912
diff
changeset
|
379 |
function cost_callback(old_path, new_tile, self) { if (old_path == null) return 0; return old_path.GetCost() + 1; } |
317f736e5fc6
(svn r13470) [NoAI] -Change [Library CHANGE]: allow in graph.aystar to give a custom param to the callbacks, so you can send in an instance of yourself
truebrain
parents:
10912
diff
changeset
|
380 |
function estimate_callback(tile, goals, self) { return goals[0] - tile; } |
317f736e5fc6
(svn r13470) [NoAI] -Change [Library CHANGE]: allow in graph.aystar to give a custom param to the callbacks, so you can send in an instance of yourself
truebrain
parents:
10912
diff
changeset
|
381 |
function neighbours_callback(path, cur_tile, self) { return [cur_tile + 1]; } |
10910
85f71706f496
(svn r13461) [NoAI] -Fix: add A* to regression, so we test it a bit (very basic test ;))
truebrain
parents:
10904
diff
changeset
|
382 |
|
85f71706f496
(svn r13461) [NoAI] -Fix: add A* to regression, so we test it a bit (very basic test ;))
truebrain
parents:
10904
diff
changeset
|
383 |
function Regression::Graph() |
85f71706f496
(svn r13461) [NoAI] -Fix: add A* to regression, so we test it a bit (very basic test ;))
truebrain
parents:
10904
diff
changeset
|
384 |
{ |
85f71706f496
(svn r13461) [NoAI] -Fix: add A* to regression, so we test it a bit (very basic test ;))
truebrain
parents:
10904
diff
changeset
|
385 |
print("--AyStar--"); |
85f71706f496
(svn r13461) [NoAI] -Fix: add A* to regression, so we test it a bit (very basic test ;))
truebrain
parents:
10904
diff
changeset
|
386 |
print(" Fastest path:"); |
10912
48d072a192b5
(svn r13463) [NoAI] -Change [Library CHANGE]: AyStar is now more object oriented, and you can indicate the amount of iterations FindPath should do in one go (tnx to Yexo and TrueBrain)
truebrain
parents:
10910
diff
changeset
|
387 |
local as = AS(cost_callback, estimate_callback, neighbours_callback); |
48d072a192b5
(svn r13463) [NoAI] -Change [Library CHANGE]: AyStar is now more object oriented, and you can indicate the amount of iterations FindPath should do in one go (tnx to Yexo and TrueBrain)
truebrain
parents:
10910
diff
changeset
|
388 |
|
48d072a192b5
(svn r13463) [NoAI] -Change [Library CHANGE]: AyStar is now more object oriented, and you can indicate the amount of iterations FindPath should do in one go (tnx to Yexo and TrueBrain)
truebrain
parents:
10910
diff
changeset
|
389 |
local path = false; |
48d072a192b5
(svn r13463) [NoAI] -Change [Library CHANGE]: AyStar is now more object oriented, and you can indicate the amount of iterations FindPath should do in one go (tnx to Yexo and TrueBrain)
truebrain
parents:
10910
diff
changeset
|
390 |
as.InitializePath([1], [10]); |
48d072a192b5
(svn r13463) [NoAI] -Change [Library CHANGE]: AyStar is now more object oriented, and you can indicate the amount of iterations FindPath should do in one go (tnx to Yexo and TrueBrain)
truebrain
parents:
10910
diff
changeset
|
391 |
while (path == false) path = as.FindPath(5); |
48d072a192b5
(svn r13463) [NoAI] -Change [Library CHANGE]: AyStar is now more object oriented, and you can indicate the amount of iterations FindPath should do in one go (tnx to Yexo and TrueBrain)
truebrain
parents:
10910
diff
changeset
|
392 |
|
10910
85f71706f496
(svn r13461) [NoAI] -Fix: add A* to regression, so we test it a bit (very basic test ;))
truebrain
parents:
10904
diff
changeset
|
393 |
while (path != null) { |
10912
48d072a192b5
(svn r13463) [NoAI] -Change [Library CHANGE]: AyStar is now more object oriented, and you can indicate the amount of iterations FindPath should do in one go (tnx to Yexo and TrueBrain)
truebrain
parents:
10910
diff
changeset
|
394 |
print(" Tile " + path.GetNode()); |
10910
85f71706f496
(svn r13461) [NoAI] -Fix: add A* to regression, so we test it a bit (very basic test ;))
truebrain
parents:
10904
diff
changeset
|
395 |
path = path.GetParent(); |
85f71706f496
(svn r13461) [NoAI] -Fix: add A* to regression, so we test it a bit (very basic test ;))
truebrain
parents:
10904
diff
changeset
|
396 |
} |
85f71706f496
(svn r13461) [NoAI] -Fix: add A* to regression, so we test it a bit (very basic test ;))
truebrain
parents:
10904
diff
changeset
|
397 |
} |
85f71706f496
(svn r13461) [NoAI] -Fix: add A* to regression, so we test it a bit (very basic test ;))
truebrain
parents:
10904
diff
changeset
|
398 |
|
9460
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
399 |
function Regression::Industry() |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
400 |
{ |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
401 |
local j = 0; |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
402 |
|
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
403 |
print(""); |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
404 |
print("--Industry--"); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
405 |
print(" GetMaxIndustryID(): " + AIIndustry.GetMaxIndustryID()); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
406 |
print(" GetIndustryCount(): " + AIIndustry.GetIndustryCount()); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
407 |
for (local i = -1; i < AIIndustry.GetMaxIndustryID() + 1; i++) { |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
408 |
if (AIIndustry.IsValidIndustry(i)) j++; |
9460
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
409 |
print(" Industry " + i); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
410 |
print(" IsValidIndustry(): " + AIIndustry.IsValidIndustry(i)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
411 |
print(" GetName(): " + AIIndustry.GetName(i)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
412 |
print(" GetLocation(): " + AIIndustry.GetLocation(i)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
413 |
print(" GetProduction(): " + AIIndustry.GetProduction(i, 1)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
414 |
print(" IsCargoAccepted(): " + AIIndustry.IsCargoAccepted(i, 1)); |
9810
a84fc1be9e3b
(svn r12327) [NoAI] -Add: GetLastMonth(Production|Transported) (Morloth)
truebrain
parents:
9809
diff
changeset
|
415 |
|
a84fc1be9e3b
(svn r12327) [NoAI] -Add: GetLastMonth(Production|Transported) (Morloth)
truebrain
parents:
9809
diff
changeset
|
416 |
local cargo_list = AICargoList(); |
a84fc1be9e3b
(svn r12327) [NoAI] -Add: GetLastMonth(Production|Transported) (Morloth)
truebrain
parents:
9809
diff
changeset
|
417 |
for (local j = cargo_list.Begin(); cargo_list.HasNext(); j = cargo_list.Next()) { |
a84fc1be9e3b
(svn r12327) [NoAI] -Add: GetLastMonth(Production|Transported) (Morloth)
truebrain
parents:
9809
diff
changeset
|
418 |
if (AIIndustry.GetProduction(i, j) > 0) { |
a84fc1be9e3b
(svn r12327) [NoAI] -Add: GetLastMonth(Production|Transported) (Morloth)
truebrain
parents:
9809
diff
changeset
|
419 |
print(" GetLastMonthProduction(): " + AIIndustry.GetLastMonthProduction(i, j)); |
a84fc1be9e3b
(svn r12327) [NoAI] -Add: GetLastMonth(Production|Transported) (Morloth)
truebrain
parents:
9809
diff
changeset
|
420 |
print(" GetLastMonthTransported(): " + AIIndustry.GetLastMonthTransported(i, j)); |
a84fc1be9e3b
(svn r12327) [NoAI] -Add: GetLastMonth(Production|Transported) (Morloth)
truebrain
parents:
9809
diff
changeset
|
421 |
} |
a84fc1be9e3b
(svn r12327) [NoAI] -Add: GetLastMonth(Production|Transported) (Morloth)
truebrain
parents:
9809
diff
changeset
|
422 |
} |
9460
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
423 |
} |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
424 |
print(" Valid Industries: " + j); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
425 |
print(" GetIndustryCount(): " + AIIndustry.GetIndustryCount()); |
9460
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
426 |
} |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
427 |
|
9649
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
428 |
function Regression::IndustryList() |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
429 |
{ |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
430 |
local list = AIIndustryList(); |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
431 |
|
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
432 |
print(""); |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
433 |
print("--IndustryList--"); |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
434 |
print(" Count(): " + list.Count()); |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
435 |
list.Valuate(AIIndustry.GetLocation); |
9649
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
436 |
print(" Location ListDump:"); |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
437 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
438 |
print(" " + i + " => " + list.GetValue(i)); |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
439 |
} |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
440 |
list.Valuate(AIIndustry.GetDistanceManhattanToTile, 30000); |
9655
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9654
diff
changeset
|
441 |
print(" DistanceManhattanToTile(30000) ListDump:"); |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9654
diff
changeset
|
442 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9654
diff
changeset
|
443 |
print(" " + i + " => " + list.GetValue(i)); |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9654
diff
changeset
|
444 |
} |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
445 |
list.Valuate(AIIndustry.GetDistanceSquareToTile, 30000); |
9655
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9654
diff
changeset
|
446 |
print(" DistanceSquareToTile(30000) ListDump:"); |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9654
diff
changeset
|
447 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9654
diff
changeset
|
448 |
print(" " + i + " => " + list.GetValue(i)); |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9654
diff
changeset
|
449 |
} |
10383
bda80b3e9c25
(svn r12925) [NoAI] -Add: added AIIndustry::GetAmountOfStationsAround() (Yexo)
truebrain
parents:
10381
diff
changeset
|
450 |
list.Valuate(AIIndustry.GetAmountOfStationsAround); |
bda80b3e9c25
(svn r12925) [NoAI] -Add: added AIIndustry::GetAmountOfStationsAround() (Yexo)
truebrain
parents:
10381
diff
changeset
|
451 |
print(" GetAmountOfStationsAround(30000) ListDump:"); |
bda80b3e9c25
(svn r12925) [NoAI] -Add: added AIIndustry::GetAmountOfStationsAround() (Yexo)
truebrain
parents:
10381
diff
changeset
|
452 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
bda80b3e9c25
(svn r12925) [NoAI] -Add: added AIIndustry::GetAmountOfStationsAround() (Yexo)
truebrain
parents:
10381
diff
changeset
|
453 |
print(" " + i + " => " + list.GetValue(i)); |
bda80b3e9c25
(svn r12925) [NoAI] -Add: added AIIndustry::GetAmountOfStationsAround() (Yexo)
truebrain
parents:
10381
diff
changeset
|
454 |
} |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
455 |
list.Valuate(AIIndustry.IsCargoAccepted, 1); |
9710
ba44f8c1fd52
(svn r11294) [NoAI] -Add: added AIIndustry::IsCargoAccepted + Valuator (on request by Kilinich)
truelight
parents:
9709
diff
changeset
|
456 |
print(" CargoAccepted(1) ListDump:"); |
ba44f8c1fd52
(svn r11294) [NoAI] -Add: added AIIndustry::IsCargoAccepted + Valuator (on request by Kilinich)
truelight
parents:
9709
diff
changeset
|
457 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
ba44f8c1fd52
(svn r11294) [NoAI] -Add: added AIIndustry::IsCargoAccepted + Valuator (on request by Kilinich)
truelight
parents:
9709
diff
changeset
|
458 |
print(" " + i + " => " + list.GetValue(i)); |
ba44f8c1fd52
(svn r11294) [NoAI] -Add: added AIIndustry::IsCargoAccepted + Valuator (on request by Kilinich)
truelight
parents:
9709
diff
changeset
|
459 |
} |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
460 |
list.Valuate(AIIndustry.GetProduction, 1); |
9649
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
461 |
list.KeepAboveValue(50); |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
462 |
print(" KeepAboveValue(50): done"); |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
463 |
print(" Count(): " + list.Count()); |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
464 |
print(" Production ListDump:"); |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
465 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
466 |
print(" " + i + " => " + list.GetValue(i)); |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
467 |
} |
9776
ee9923d46fba
(svn r12270) [NoAI] -Add: added AIIndustryList_CargoAccepting and AIIndustryList_CargoProducing, which gives you Industry Lists with from where to where you can move cargo
truebrain
parents:
9773
diff
changeset
|
468 |
|
ee9923d46fba
(svn r12270) [NoAI] -Add: added AIIndustryList_CargoAccepting and AIIndustryList_CargoProducing, which gives you Industry Lists with from where to where you can move cargo
truebrain
parents:
9773
diff
changeset
|
469 |
list = AIIndustryList_CargoAccepting(1); |
ee9923d46fba
(svn r12270) [NoAI] -Add: added AIIndustryList_CargoAccepting and AIIndustryList_CargoProducing, which gives you Industry Lists with from where to where you can move cargo
truebrain
parents:
9773
diff
changeset
|
470 |
print("--IndustryList_CargoAccepting--"); |
ee9923d46fba
(svn r12270) [NoAI] -Add: added AIIndustryList_CargoAccepting and AIIndustryList_CargoProducing, which gives you Industry Lists with from where to where you can move cargo
truebrain
parents:
9773
diff
changeset
|
471 |
print(" Count(): " + list.Count()); |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
472 |
list.Valuate(AIIndustry.GetLocation); |
9776
ee9923d46fba
(svn r12270) [NoAI] -Add: added AIIndustryList_CargoAccepting and AIIndustryList_CargoProducing, which gives you Industry Lists with from where to where you can move cargo
truebrain
parents:
9773
diff
changeset
|
473 |
print(" Location ListDump:"); |
ee9923d46fba
(svn r12270) [NoAI] -Add: added AIIndustryList_CargoAccepting and AIIndustryList_CargoProducing, which gives you Industry Lists with from where to where you can move cargo
truebrain
parents:
9773
diff
changeset
|
474 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
ee9923d46fba
(svn r12270) [NoAI] -Add: added AIIndustryList_CargoAccepting and AIIndustryList_CargoProducing, which gives you Industry Lists with from where to where you can move cargo
truebrain
parents:
9773
diff
changeset
|
475 |
print(" " + i + " => " + list.GetValue(i)); |
ee9923d46fba
(svn r12270) [NoAI] -Add: added AIIndustryList_CargoAccepting and AIIndustryList_CargoProducing, which gives you Industry Lists with from where to where you can move cargo
truebrain
parents:
9773
diff
changeset
|
476 |
} |
ee9923d46fba
(svn r12270) [NoAI] -Add: added AIIndustryList_CargoAccepting and AIIndustryList_CargoProducing, which gives you Industry Lists with from where to where you can move cargo
truebrain
parents:
9773
diff
changeset
|
477 |
|
ee9923d46fba
(svn r12270) [NoAI] -Add: added AIIndustryList_CargoAccepting and AIIndustryList_CargoProducing, which gives you Industry Lists with from where to where you can move cargo
truebrain
parents:
9773
diff
changeset
|
478 |
list = AIIndustryList_CargoProducing(1); |
ee9923d46fba
(svn r12270) [NoAI] -Add: added AIIndustryList_CargoAccepting and AIIndustryList_CargoProducing, which gives you Industry Lists with from where to where you can move cargo
truebrain
parents:
9773
diff
changeset
|
479 |
print("--IndustryList_CargoProducing--"); |
ee9923d46fba
(svn r12270) [NoAI] -Add: added AIIndustryList_CargoAccepting and AIIndustryList_CargoProducing, which gives you Industry Lists with from where to where you can move cargo
truebrain
parents:
9773
diff
changeset
|
480 |
print(" Count(): " + list.Count()); |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
481 |
list.Valuate(AIIndustry.GetLocation); |
9776
ee9923d46fba
(svn r12270) [NoAI] -Add: added AIIndustryList_CargoAccepting and AIIndustryList_CargoProducing, which gives you Industry Lists with from where to where you can move cargo
truebrain
parents:
9773
diff
changeset
|
482 |
print(" Location ListDump:"); |
ee9923d46fba
(svn r12270) [NoAI] -Add: added AIIndustryList_CargoAccepting and AIIndustryList_CargoProducing, which gives you Industry Lists with from where to where you can move cargo
truebrain
parents:
9773
diff
changeset
|
483 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
ee9923d46fba
(svn r12270) [NoAI] -Add: added AIIndustryList_CargoAccepting and AIIndustryList_CargoProducing, which gives you Industry Lists with from where to where you can move cargo
truebrain
parents:
9773
diff
changeset
|
484 |
print(" " + i + " => " + list.GetValue(i)); |
ee9923d46fba
(svn r12270) [NoAI] -Add: added AIIndustryList_CargoAccepting and AIIndustryList_CargoProducing, which gives you Industry Lists with from where to where you can move cargo
truebrain
parents:
9773
diff
changeset
|
485 |
} |
9649
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
486 |
} |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
487 |
|
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
488 |
function CustomValuator(list_id) |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
489 |
{ |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
490 |
return list_id * 4343; |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
491 |
} |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
492 |
|
9579
632263c0cf5a
(svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents:
9575
diff
changeset
|
493 |
function Regression::List() |
632263c0cf5a
(svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents:
9575
diff
changeset
|
494 |
{ |
632263c0cf5a
(svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents:
9575
diff
changeset
|
495 |
local list = AIList(); |
632263c0cf5a
(svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents:
9575
diff
changeset
|
496 |
|
632263c0cf5a
(svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents:
9575
diff
changeset
|
497 |
print(""); |
632263c0cf5a
(svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents:
9575
diff
changeset
|
498 |
print("--List--"); |
632263c0cf5a
(svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents:
9575
diff
changeset
|
499 |
|
632263c0cf5a
(svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents:
9575
diff
changeset
|
500 |
print(" IsEmpty(): " + list.IsEmpty()); |
9664
c5741021bf59
(svn r10577) [NoAI] -Add: added ChangeItem to AIList
truelight
parents:
9660
diff
changeset
|
501 |
list.AddItem(1, 1); |
c5741021bf59
(svn r10577) [NoAI] -Add: added ChangeItem to AIList
truelight
parents:
9660
diff
changeset
|
502 |
list.AddItem(2, 2); |
9579
632263c0cf5a
(svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents:
9575
diff
changeset
|
503 |
for (local i = 1000; i < 1100; i++) { |
9664
c5741021bf59
(svn r10577) [NoAI] -Add: added ChangeItem to AIList
truelight
parents:
9660
diff
changeset
|
504 |
list.AddItem(i, i); |
9579
632263c0cf5a
(svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents:
9575
diff
changeset
|
505 |
} |
632263c0cf5a
(svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents:
9575
diff
changeset
|
506 |
list.RemoveItem(1050); |
632263c0cf5a
(svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents:
9575
diff
changeset
|
507 |
list.RemoveItem(1150); |
9664
c5741021bf59
(svn r10577) [NoAI] -Add: added ChangeItem to AIList
truelight
parents:
9660
diff
changeset
|
508 |
list.ChangeItem(1051, 12); |
9579
632263c0cf5a
(svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents:
9575
diff
changeset
|
509 |
print(" Count(): " + list.Count()); |
632263c0cf5a
(svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents:
9575
diff
changeset
|
510 |
print(" HasItem(1050): " + list.HasItem(1050)); |
632263c0cf5a
(svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents:
9575
diff
changeset
|
511 |
print(" HasItem(1051): " + list.HasItem(1051)); |
632263c0cf5a
(svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents:
9575
diff
changeset
|
512 |
print(" IsEmpty(): " + list.IsEmpty()); |
9665
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
513 |
list.Sort(AIAbstractList.SORT_BY_ITEM, true); |
9579
632263c0cf5a
(svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents:
9575
diff
changeset
|
514 |
print(" List Dump:"); |
632263c0cf5a
(svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents:
9575
diff
changeset
|
515 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
632263c0cf5a
(svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents:
9575
diff
changeset
|
516 |
print(" " + i + " => " + list.GetValue(i)); |
632263c0cf5a
(svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents:
9575
diff
changeset
|
517 |
} |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
518 |
list.Valuate(CustomValuator); |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
519 |
print(" Custom ListDump:"); |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
520 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
521 |
print(" " + i + " => " + list.GetValue(i)); |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
522 |
} |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
523 |
list.Valuate(AIBase.RandItem); |
9660
d0a430e8310b
(svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents:
9658
diff
changeset
|
524 |
print(" Randomize ListDump:"); |
d0a430e8310b
(svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents:
9658
diff
changeset
|
525 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
d0a430e8310b
(svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents:
9658
diff
changeset
|
526 |
print(" " + i + " => " + list.GetValue(i)); |
d0a430e8310b
(svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents:
9658
diff
changeset
|
527 |
} |
9665
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
528 |
|
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
529 |
list.KeepTop(10); |
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
530 |
print(" KeepTop(10):"); |
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
531 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
532 |
print(" " + i + " => " + list.GetValue(i)); |
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
533 |
} |
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
534 |
list.KeepBottom(8); |
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
535 |
print(" KeepBottom(8):"); |
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
536 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
537 |
print(" " + i + " => " + list.GetValue(i)); |
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
538 |
} |
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
539 |
list.RemoveBottom(2); |
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
540 |
print(" RemoveBottom(2):"); |
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
541 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
542 |
print(" " + i + " => " + list.GetValue(i)); |
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
543 |
} |
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
544 |
list.RemoveTop(2); |
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
545 |
print(" RemoveTop(2):"); |
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
546 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
547 |
print(" " + i + " => " + list.GetValue(i)); |
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
548 |
} |
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
549 |
|
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
550 |
local list2 = AIList(); |
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
551 |
list2.AddItem(1003, 0); |
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
552 |
list2.AddItem(1004, 0); |
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
553 |
list.RemoveList(list2); |
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
554 |
print(" RemoveList({1003, 1004}):"); |
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
555 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
556 |
print(" " + i + " => " + list.GetValue(i)); |
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
557 |
} |
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
558 |
list2.AddItem(1005, 0); |
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
559 |
list.KeepList(list2); |
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
560 |
print(" KeepList({1003, 1004, 1005}):"); |
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
561 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
562 |
print(" " + i + " => " + list.GetValue(i)); |
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
563 |
} |
9796
83d54622190c
(svn r12300) [NoAI] -Add: added AIAbstractList.AddList() (on request by Progman)
truebrain
parents:
9794
diff
changeset
|
564 |
list2.Clear(); |
83d54622190c
(svn r12300) [NoAI] -Add: added AIAbstractList.AddList() (on request by Progman)
truebrain
parents:
9794
diff
changeset
|
565 |
for (local i = 4000; i < 4003; i++) { |
83d54622190c
(svn r12300) [NoAI] -Add: added AIAbstractList.AddList() (on request by Progman)
truebrain
parents:
9794
diff
changeset
|
566 |
list2.AddItem(i, i); |
83d54622190c
(svn r12300) [NoAI] -Add: added AIAbstractList.AddList() (on request by Progman)
truebrain
parents:
9794
diff
changeset
|
567 |
} |
83d54622190c
(svn r12300) [NoAI] -Add: added AIAbstractList.AddList() (on request by Progman)
truebrain
parents:
9794
diff
changeset
|
568 |
list2.AddItem(1005, 1005); |
83d54622190c
(svn r12300) [NoAI] -Add: added AIAbstractList.AddList() (on request by Progman)
truebrain
parents:
9794
diff
changeset
|
569 |
list.AddList(list2); |
83d54622190c
(svn r12300) [NoAI] -Add: added AIAbstractList.AddList() (on request by Progman)
truebrain
parents:
9794
diff
changeset
|
570 |
print(" AddList({1005, 4000, 4001, 4002}):"); |
83d54622190c
(svn r12300) [NoAI] -Add: added AIAbstractList.AddList() (on request by Progman)
truebrain
parents:
9794
diff
changeset
|
571 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
83d54622190c
(svn r12300) [NoAI] -Add: added AIAbstractList.AddList() (on request by Progman)
truebrain
parents:
9794
diff
changeset
|
572 |
print(" " + i + " => " + list.GetValue(i)); |
83d54622190c
(svn r12300) [NoAI] -Add: added AIAbstractList.AddList() (on request by Progman)
truebrain
parents:
9794
diff
changeset
|
573 |
} |
9665
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
574 |
|
9579
632263c0cf5a
(svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents:
9575
diff
changeset
|
575 |
list.Clear(); |
632263c0cf5a
(svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents:
9575
diff
changeset
|
576 |
print(" IsEmpty(): " + list.IsEmpty()); |
632263c0cf5a
(svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents:
9575
diff
changeset
|
577 |
} |
632263c0cf5a
(svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents:
9575
diff
changeset
|
578 |
|
9460
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
579 |
function Regression::Map() |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
580 |
{ |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
581 |
print(""); |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
582 |
print("--Map--"); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
583 |
print(" GetMapSize(): " + AIMap.GetMapSize()); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
584 |
print(" GetMapSizeX(): " + AIMap.GetMapSizeX()); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
585 |
print(" GetMapSizeY(): " + AIMap.GetMapSizeY()); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
586 |
print(" GetTileX(123): " + AIMap.GetTileX(123)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
587 |
print(" GetTileY(123): " + AIMap.GetTileY(123)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
588 |
print(" GetTileIndex(): " + AIMap.GetTileIndex(123, 0)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
589 |
print(" GetTileIndex(): " + AIMap.GetTileIndex(0, 123)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
590 |
print(" GetTileIndex(): " + AIMap.GetTileIndex(0, 0)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
591 |
print(" GetTileIndex(): " + AIMap.GetTileIndex(-1, -1)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
592 |
print(" GetTileIndex(): " + AIMap.GetTileIndex(10000, 10000)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
593 |
print(" IsValidTile(123): " + AIMap.IsValidTile(123)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
594 |
print(" GetTileX(124): " + AIMap.GetTileX(124)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
595 |
print(" GetTileY(124): " + AIMap.GetTileY(124)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
596 |
print(" IsValidTile(124): " + AIMap.IsValidTile(124)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
597 |
print(" IsValidTile(0): " + AIMap.IsValidTile(0)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
598 |
print(" IsValidTile(-1): " + AIMap.IsValidTile(-1)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
599 |
print(" IsValidTile(): " + AIMap.IsValidTile(AIMap.GetMapSize())); |
9801
03a3eebd7fb7
(svn r12307) [NoAI] -Codechange: as followup on r12303 (trunk), use ::IsValidTile to check if a tile is inside the map, instead of all our custom ways
truebrain
parents:
9796
diff
changeset
|
600 |
print(" IsValidTile(): " + AIMap.IsValidTile(AIMap.GetMapSize() - AIMap.GetMapSizeX() - 2)); |
9834
9abe20fc83e5
(svn r12497) [NoAI] -Change [API CHANGE]: AIMap.DemolishTile -> AITile.DemolishTile (that makes much more sense, doesn't it? ;))
truebrain
parents:
9831
diff
changeset
|
601 |
print(" DemolishTile(): " + AITile.DemolishTile(19592)); |
9abe20fc83e5
(svn r12497) [NoAI] -Change [API CHANGE]: AIMap.DemolishTile -> AITile.DemolishTile (that makes much more sense, doesn't it? ;))
truebrain
parents:
9831
diff
changeset
|
602 |
print(" DemolishTile(): " + AITile.DemolishTile(19335)); |
9492
1aeee24046d8
(svn r9362) [NoAI] -Add: added the new AIMap() functions to regression-test
truelight
parents:
9487
diff
changeset
|
603 |
print(" Distance"); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
604 |
print(" DistanceManhattan(): " + AIMap.DistanceManhattan(1, 10000)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
605 |
print(" DistanceMax(): " + AIMap.DistanceMax(1, 10000)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
606 |
print(" DistanceSquare(): " + AIMap.DistanceSquare(1, 10000)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
607 |
print(" DistanceFromEdge(): " + AIMap.DistanceFromEdge(10000)); |
9460
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
608 |
} |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
609 |
|
9691
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
9684
diff
changeset
|
610 |
function Regression::Marine() |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
9684
diff
changeset
|
611 |
{ |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
9684
diff
changeset
|
612 |
print(""); |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
9684
diff
changeset
|
613 |
print("--AIMarine--"); |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
9684
diff
changeset
|
614 |
|
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
615 |
print(" IsWaterDepotTile(): " + AIMarine.IsWaterDepotTile(32116)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
616 |
print(" IsDockTile(): " + AIMarine.IsDockTile(32116)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
617 |
print(" IsBuoyTile(): " + AIMarine.IsBuoyTile(32116)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
618 |
print(" IsLockTile(): " + AIMarine.IsLockTile(32116)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
619 |
print(" IsCanalTile(): " + AIMarine.IsCanalTile(32116)); |
9691
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
9684
diff
changeset
|
620 |
|
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
621 |
print(" GetBankBalance(): " + AICompany.GetBankBalance(AICompany.MY_COMPANY)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
622 |
print(" BuildWaterDepot(): " + AIMarine.BuildWaterDepot(28479, false)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
623 |
print(" BuildDock(): " + AIMarine.BuildDock(29253)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
624 |
print(" BuildBuoy(): " + AIMarine.BuildBuoy(28481)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
625 |
print(" BuildLock(): " + AIMarine.BuildLock(28487)); |
10933
57aa2e01942c
(svn r13486) [NoAI] -Add: function to determine what TransportTypes a tile holds.
rubidium
parents:
10931
diff
changeset
|
626 |
print(" HasTransportType(): " + AITile.HasTransportType(32127, AITile.TRANSPORT_WATER)); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
627 |
print(" BuildCanal(): " + AIMarine.BuildCanal(32127)); |
10933
57aa2e01942c
(svn r13486) [NoAI] -Add: function to determine what TransportTypes a tile holds.
rubidium
parents:
10931
diff
changeset
|
628 |
print(" HasTransportType(): " + AITile.HasTransportType(32127, AITile.TRANSPORT_WATER)); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
629 |
print(" IsWaterDepotTile(): " + AIMarine.IsWaterDepotTile(28479)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
630 |
print(" IsDockTile(): " + AIMarine.IsDockTile(29253)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
631 |
print(" IsBuoyTile(): " + AIMarine.IsBuoyTile(28481)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
632 |
print(" IsLockTile(): " + AIMarine.IsLockTile(28487)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
633 |
print(" IsCanalTile(): " + AIMarine.IsCanalTile(32127)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
634 |
print(" GetBankBalance(): " + AICompany.GetBankBalance(AICompany.MY_COMPANY)); |
9691
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
9684
diff
changeset
|
635 |
|
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
636 |
print(" RemoveWaterDepot(): " + AIMarine.RemoveWaterDepot(28479)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
637 |
print(" RemoveDock(): " + AIMarine.RemoveDock(29253)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
638 |
print(" RemoveBuoy(): " + AIMarine.RemoveBuoy(28481)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
639 |
print(" RemoveLock(): " + AIMarine.RemoveLock(28487)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
640 |
print(" RemoveCanal(): " + AIMarine.RemoveCanal(32127)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
641 |
print(" IsWaterDepotTile(): " + AIMarine.IsWaterDepotTile(28479)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
642 |
print(" IsDockTile(): " + AIMarine.IsDockTile(29253)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
643 |
print(" IsBuoyTile(): " + AIMarine.IsBuoyTile(28481)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
644 |
print(" IsLockTile(): " + AIMarine.IsLockTile(28487)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
645 |
print(" IsCanalTile(): " + AIMarine.IsCanalTile(32127)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
646 |
print(" GetBankBalance(): " + AICompany.GetBankBalance(AICompany.MY_COMPANY)); |
9691
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
9684
diff
changeset
|
647 |
|
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
648 |
print(" BuildWaterDepot(): " + AIMarine.BuildWaterDepot(28479, false)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
649 |
print(" BuildDock(): " + AIMarine.BuildDock(29253)); |
9691
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
9684
diff
changeset
|
650 |
} |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
9684
diff
changeset
|
651 |
|
9546
fde20f518285
(svn r9477) [NoAI] -Add: added regression-test for AIOrder()
truelight
parents:
9541
diff
changeset
|
652 |
function Regression::Order() |
fde20f518285
(svn r9477) [NoAI] -Add: added regression-test for AIOrder()
truelight
parents:
9541
diff
changeset
|
653 |
{ |
fde20f518285
(svn r9477) [NoAI] -Add: added regression-test for AIOrder()
truelight
parents:
9541
diff
changeset
|
654 |
print(""); |
fde20f518285
(svn r9477) [NoAI] -Add: added regression-test for AIOrder()
truelight
parents:
9541
diff
changeset
|
655 |
print("--Order--"); |
10844
affb2821fb9f
(svn r13395) [NoAI] -Fix [API CHANGE]: Rename AIOrder::GetNumberOfORders to AIOrder::GetOrderCount
truebrain
parents:
10831
diff
changeset
|
656 |
print(" GetOrderCount(): " + AIOrder.GetOrderCount(11)); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
657 |
print(" GetOrderDestination(): " + AIOrder.GetOrderDestination(11, 1)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
658 |
print(" AreOrderFlagsValid(): " + AIOrder.AreOrderFlagsValid(33416, AIOrder.AIOF_TRANSFER)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
659 |
print(" IsValidVehicleOrder(): " + AIOrder.IsValidVehicleOrder(11, 1)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
660 |
print(" GetOrderFlags(): " + AIOrder.GetOrderFlags(11, 1)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
661 |
print(" AppendOrder(): " + AIOrder.AppendOrder(11, 33416, AIOrder.AIOF_TRANSFER)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
662 |
print(" InsertOrder(): " + AIOrder.InsertOrder(11, 0, 33416, AIOrder.AIOF_TRANSFER)); |
10844
affb2821fb9f
(svn r13395) [NoAI] -Fix [API CHANGE]: Rename AIOrder::GetNumberOfORders to AIOrder::GetOrderCount
truebrain
parents:
10831
diff
changeset
|
663 |
print(" GetOrderCount(): " + AIOrder.GetOrderCount(11)); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
664 |
print(" IsValidVehicleOrder(): " + AIOrder.IsValidVehicleOrder(11, 1)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
665 |
print(" RemoveOrder(): " + AIOrder.RemoveOrder(11, 0)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
666 |
print(" ChangeOrder(): " + AIOrder.ChangeOrder(11, 0, AIOrder.AIOF_FULL_LOAD)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
667 |
print(" GetOrderDestination(): " + AIOrder.GetOrderDestination(11, 0)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
668 |
print(" CopyOrders(): " + AIOrder.CopyOrders(11, 1)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
669 |
print(" CopyOrders(): " + AIOrder.CopyOrders(12, 11)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
670 |
print(" ShareOrders(): " + AIOrder.ShareOrders(12, 1)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
671 |
print(" ShareOrders(): " + AIOrder.ShareOrders(12, 11)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
672 |
print(" UnshareOrders(): " + AIOrder.UnshareOrders(12)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
673 |
print(" AppendOrder(): " + AIOrder.AppendOrder(11, 33421, AIOrder.AIOF_NONE)); |
9645
25126afa0c25
(svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents:
9638
diff
changeset
|
674 |
|
9745
fb2454d70f37
(svn r12225) [NoAI] -Change [API CHANGE]: AIStationVehicleList -> AIVehicleList_Station (WATCH THE NAMES CAREFULLY!)
truebrain
parents:
9737
diff
changeset
|
675 |
local list = AIStationList_Vehicle(11); |
9645
25126afa0c25
(svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents:
9638
diff
changeset
|
676 |
|
25126afa0c25
(svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents:
9638
diff
changeset
|
677 |
print(""); |
9745
fb2454d70f37
(svn r12225) [NoAI] -Change [API CHANGE]: AIStationVehicleList -> AIVehicleList_Station (WATCH THE NAMES CAREFULLY!)
truebrain
parents:
9737
diff
changeset
|
678 |
print("--StationList_Vehicle--"); |
9645
25126afa0c25
(svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents:
9638
diff
changeset
|
679 |
print(" Count(): " + list.Count()); |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
680 |
list.Valuate(AIStation.GetLocation); |
9645
25126afa0c25
(svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents:
9638
diff
changeset
|
681 |
print(" Location ListDump:"); |
25126afa0c25
(svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents:
9638
diff
changeset
|
682 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
25126afa0c25
(svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents:
9638
diff
changeset
|
683 |
print(" " + i + " => " + list.GetValue(i)); |
25126afa0c25
(svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents:
9638
diff
changeset
|
684 |
} |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
685 |
list.Valuate(AIStation.GetCargoWaiting, 0); |
9645
25126afa0c25
(svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents:
9638
diff
changeset
|
686 |
print(" CargoWaiting(0) ListDump:"); |
25126afa0c25
(svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents:
9638
diff
changeset
|
687 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
25126afa0c25
(svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents:
9638
diff
changeset
|
688 |
print(" " + i + " => " + list.GetValue(i)); |
25126afa0c25
(svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents:
9638
diff
changeset
|
689 |
} |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
690 |
list.Valuate(AIStation.GetCargoWaiting, 1); |
9645
25126afa0c25
(svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents:
9638
diff
changeset
|
691 |
print(" CargoWaiting(1) ListDump:"); |
25126afa0c25
(svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents:
9638
diff
changeset
|
692 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
25126afa0c25
(svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents:
9638
diff
changeset
|
693 |
print(" " + i + " => " + list.GetValue(i)); |
25126afa0c25
(svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents:
9638
diff
changeset
|
694 |
} |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
695 |
list.Valuate(AIStation.GetCargoRating, 1); |
9648
760b7b504e37
(svn r10543) [NoAI] -Add: added AIStationListCargoRating as valuator for a station list
truelight
parents:
9647
diff
changeset
|
696 |
print(" CargoRating(1) ListDump:"); |
760b7b504e37
(svn r10543) [NoAI] -Add: added AIStationListCargoRating as valuator for a station list
truelight
parents:
9647
diff
changeset
|
697 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
760b7b504e37
(svn r10543) [NoAI] -Add: added AIStationListCargoRating as valuator for a station list
truelight
parents:
9647
diff
changeset
|
698 |
print(" " + i + " => " + list.GetValue(i)); |
760b7b504e37
(svn r10543) [NoAI] -Add: added AIStationListCargoRating as valuator for a station list
truelight
parents:
9647
diff
changeset
|
699 |
} |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
700 |
list.Valuate(AIStation.GetDistanceManhattanToTile, 30000); |
9655
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9654
diff
changeset
|
701 |
print(" DistanceManhattanToTile(30000) ListDump:"); |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9654
diff
changeset
|
702 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9654
diff
changeset
|
703 |
print(" " + i + " => " + list.GetValue(i)); |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9654
diff
changeset
|
704 |
} |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
705 |
list.Valuate(AIStation.GetDistanceSquareToTile, 30000); |
9655
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9654
diff
changeset
|
706 |
print(" DistanceSquareToTile(30000) ListDump:"); |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9654
diff
changeset
|
707 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9654
diff
changeset
|
708 |
print(" " + i + " => " + list.GetValue(i)); |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9654
diff
changeset
|
709 |
} |
10361
4cdffd48480f
(svn r12902) [NoAI] -Fix r12901 [API CHANGE]: renamed IsWithinTownRadius to IsWithinTownInfluence, as that reflects the meaning much better
truebrain
parents:
10360
diff
changeset
|
710 |
list.Valuate(AIStation.IsWithinTownInfluence, 0); |
4cdffd48480f
(svn r12902) [NoAI] -Fix r12901 [API CHANGE]: renamed IsWithinTownRadius to IsWithinTownInfluence, as that reflects the meaning much better
truebrain
parents:
10360
diff
changeset
|
711 |
print(" IsWithinTownInfluence(0) ListDump:"); |
10360
3234cb59de55
(svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents:
10344
diff
changeset
|
712 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
3234cb59de55
(svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents:
10344
diff
changeset
|
713 |
print(" " + i + " => " + list.GetValue(i)); |
3234cb59de55
(svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents:
10344
diff
changeset
|
714 |
} |
9647
c17046b1b8a2
(svn r10540) [NoAI] -Add: added AIStationVehicleList, which lists all vehicles that go to a given station
truelight
parents:
9645
diff
changeset
|
715 |
|
9745
fb2454d70f37
(svn r12225) [NoAI] -Change [API CHANGE]: AIStationVehicleList -> AIVehicleList_Station (WATCH THE NAMES CAREFULLY!)
truebrain
parents:
9737
diff
changeset
|
716 |
list = AIVehicleList_Station(3); |
9647
c17046b1b8a2
(svn r10540) [NoAI] -Add: added AIStationVehicleList, which lists all vehicles that go to a given station
truelight
parents:
9645
diff
changeset
|
717 |
|
c17046b1b8a2
(svn r10540) [NoAI] -Add: added AIStationVehicleList, which lists all vehicles that go to a given station
truelight
parents:
9645
diff
changeset
|
718 |
print(""); |
9745
fb2454d70f37
(svn r12225) [NoAI] -Change [API CHANGE]: AIStationVehicleList -> AIVehicleList_Station (WATCH THE NAMES CAREFULLY!)
truebrain
parents:
9737
diff
changeset
|
719 |
print("--VehicleList_Station--"); |
9647
c17046b1b8a2
(svn r10540) [NoAI] -Add: added AIStationVehicleList, which lists all vehicles that go to a given station
truelight
parents:
9645
diff
changeset
|
720 |
print(" Count(): " + list.Count()); |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
721 |
list.Valuate(AIVehicle.GetLocation); |
9647
c17046b1b8a2
(svn r10540) [NoAI] -Add: added AIStationVehicleList, which lists all vehicles that go to a given station
truelight
parents:
9645
diff
changeset
|
722 |
print(" Location ListDump:"); |
c17046b1b8a2
(svn r10540) [NoAI] -Add: added AIStationVehicleList, which lists all vehicles that go to a given station
truelight
parents:
9645
diff
changeset
|
723 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
c17046b1b8a2
(svn r10540) [NoAI] -Add: added AIStationVehicleList, which lists all vehicles that go to a given station
truelight
parents:
9645
diff
changeset
|
724 |
print(" " + i + " => " + list.GetValue(i)); |
c17046b1b8a2
(svn r10540) [NoAI] -Add: added AIStationVehicleList, which lists all vehicles that go to a given station
truelight
parents:
9645
diff
changeset
|
725 |
} |
9546
fde20f518285
(svn r9477) [NoAI] -Add: added regression-test for AIOrder()
truelight
parents:
9541
diff
changeset
|
726 |
} |
fde20f518285
(svn r9477) [NoAI] -Add: added regression-test for AIOrder()
truelight
parents:
9541
diff
changeset
|
727 |
|
10896
6bb839ed0002
(svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents:
10889
diff
changeset
|
728 |
function Regression::QueueTest(queue) |
6bb839ed0002
(svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents:
10889
diff
changeset
|
729 |
{ |
6bb839ed0002
(svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents:
10889
diff
changeset
|
730 |
print(" Count(): " + queue.Count()); |
6bb839ed0002
(svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents:
10889
diff
changeset
|
731 |
print(" Peek(): " + queue.Peek()); |
6bb839ed0002
(svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents:
10889
diff
changeset
|
732 |
print(" Pop(): " + queue.Pop()); |
10904
3070af6d1d25
(svn r13455) [NoAI] -Fix: extend the regression to test the queues a bit more
truebrain
parents:
10899
diff
changeset
|
733 |
queue.Insert(6, 20); |
3070af6d1d25
(svn r13455) [NoAI] -Fix: extend the regression to test the queues a bit more
truebrain
parents:
10899
diff
changeset
|
734 |
queue.Insert(7, 40); |
3070af6d1d25
(svn r13455) [NoAI] -Fix: extend the regression to test the queues a bit more
truebrain
parents:
10899
diff
changeset
|
735 |
queue.Insert(2, 10); |
3070af6d1d25
(svn r13455) [NoAI] -Fix: extend the regression to test the queues a bit more
truebrain
parents:
10899
diff
changeset
|
736 |
queue.Insert(5, 15); |
3070af6d1d25
(svn r13455) [NoAI] -Fix: extend the regression to test the queues a bit more
truebrain
parents:
10899
diff
changeset
|
737 |
queue.Insert(8, 60); |
3070af6d1d25
(svn r13455) [NoAI] -Fix: extend the regression to test the queues a bit more
truebrain
parents:
10899
diff
changeset
|
738 |
queue.Insert(1, 5); |
10896
6bb839ed0002
(svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents:
10889
diff
changeset
|
739 |
queue.Insert(3, 10); |
10904
3070af6d1d25
(svn r13455) [NoAI] -Fix: extend the regression to test the queues a bit more
truebrain
parents:
10899
diff
changeset
|
740 |
queue.Insert(9, 90); |
3070af6d1d25
(svn r13455) [NoAI] -Fix: extend the regression to test the queues a bit more
truebrain
parents:
10899
diff
changeset
|
741 |
queue.Insert(4, 10); |
10896
6bb839ed0002
(svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents:
10889
diff
changeset
|
742 |
print(" Count(): " + queue.Count()); |
6bb839ed0002
(svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents:
10889
diff
changeset
|
743 |
print(" Peek(): " + queue.Peek()); |
10904
3070af6d1d25
(svn r13455) [NoAI] -Fix: extend the regression to test the queues a bit more
truebrain
parents:
10899
diff
changeset
|
744 |
for (local i = 4; i > 0; i--) { |
3070af6d1d25
(svn r13455) [NoAI] -Fix: extend the regression to test the queues a bit more
truebrain
parents:
10899
diff
changeset
|
745 |
print(" Pop(): " + queue.Pop()); |
3070af6d1d25
(svn r13455) [NoAI] -Fix: extend the regression to test the queues a bit more
truebrain
parents:
10899
diff
changeset
|
746 |
} |
3070af6d1d25
(svn r13455) [NoAI] -Fix: extend the regression to test the queues a bit more
truebrain
parents:
10899
diff
changeset
|
747 |
queue.Insert(1, 5); |
3070af6d1d25
(svn r13455) [NoAI] -Fix: extend the regression to test the queues a bit more
truebrain
parents:
10899
diff
changeset
|
748 |
queue.Insert(10, 100); |
3070af6d1d25
(svn r13455) [NoAI] -Fix: extend the regression to test the queues a bit more
truebrain
parents:
10899
diff
changeset
|
749 |
for (local i = queue.Count(); i > 0; i--) { |
3070af6d1d25
(svn r13455) [NoAI] -Fix: extend the regression to test the queues a bit more
truebrain
parents:
10899
diff
changeset
|
750 |
print(" Pop(): " + queue.Pop()); |
3070af6d1d25
(svn r13455) [NoAI] -Fix: extend the regression to test the queues a bit more
truebrain
parents:
10899
diff
changeset
|
751 |
} |
10896
6bb839ed0002
(svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents:
10889
diff
changeset
|
752 |
print(" Peek(): " + queue.Peek()); |
6bb839ed0002
(svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents:
10889
diff
changeset
|
753 |
print(" Pop(): " + queue.Pop()); |
6bb839ed0002
(svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents:
10889
diff
changeset
|
754 |
print(" Count(): " + queue.Count()); |
6bb839ed0002
(svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents:
10889
diff
changeset
|
755 |
} |
6bb839ed0002
(svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents:
10889
diff
changeset
|
756 |
|
6bb839ed0002
(svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents:
10889
diff
changeset
|
757 |
function Regression::Queues() |
6bb839ed0002
(svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents:
10889
diff
changeset
|
758 |
{ |
6bb839ed0002
(svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents:
10889
diff
changeset
|
759 |
print(""); |
6bb839ed0002
(svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents:
10889
diff
changeset
|
760 |
print("--PriorityQueue--"); |
6bb839ed0002
(svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents:
10889
diff
changeset
|
761 |
QueueTest(PQ()); |
6bb839ed0002
(svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents:
10889
diff
changeset
|
762 |
print(""); |
6bb839ed0002
(svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents:
10889
diff
changeset
|
763 |
print("--BinaryHeap--"); |
6bb839ed0002
(svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents:
10889
diff
changeset
|
764 |
QueueTest(BH()); |
6bb839ed0002
(svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents:
10889
diff
changeset
|
765 |
} |
6bb839ed0002
(svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents:
10889
diff
changeset
|
766 |
|
9485
df09b849ca60
(svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents:
9470
diff
changeset
|
767 |
function Regression::Road() |
df09b849ca60
(svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents:
9470
diff
changeset
|
768 |
{ |
df09b849ca60
(svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents:
9470
diff
changeset
|
769 |
print(""); |
df09b849ca60
(svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents:
9470
diff
changeset
|
770 |
print("--Road--"); |
df09b849ca60
(svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents:
9470
diff
changeset
|
771 |
print(" Road"); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
772 |
print(" IsRoadTile(): " + AIRoad.IsRoadTile(33411)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
773 |
print(" BuildRoad(): " + AIRoad.BuildRoad(0, 1)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
774 |
print(" BuildRoad(): " + AIRoad.BuildRoad(33411, 33411)); |
10933
57aa2e01942c
(svn r13486) [NoAI] -Add: function to determine what TransportTypes a tile holds.
rubidium
parents:
10931
diff
changeset
|
775 |
print(" HasTransportType(): " + AITile.HasTransportType(33413, AITile.TRANSPORT_ROAD)); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
776 |
print(" BuildRoad(): " + AIRoad.BuildRoad(33411, 33414)); |
10933
57aa2e01942c
(svn r13486) [NoAI] -Add: function to determine what TransportTypes a tile holds.
rubidium
parents:
10931
diff
changeset
|
777 |
print(" HasTransportType(): " + AITile.HasTransportType(33413, AITile.TRANSPORT_ROAD)); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
778 |
print(" AreRoadTilesConnected(): " + AIRoad.AreRoadTilesConnected(33412, 33413)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
779 |
print(" IsRoadTile(): " + AIRoad.IsRoadTile(33411)); |
10668
495789401303
(svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents:
10650
diff
changeset
|
780 |
print(" HasRoadType(Road): " + AIRoad.HasRoadType(33411, AIRoad.ROADTYPE_ROAD)); |
495789401303
(svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents:
10650
diff
changeset
|
781 |
print(" HasRoadType(Tram): " + AIRoad.HasRoadType(33411, AIRoad.ROADTYPE_TRAM)); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
782 |
print(" GetNeighbourRoadCount(): " + AIRoad.GetNeighbourRoadCount(33412)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
783 |
print(" RemoveRoad(): " + AIRoad.RemoveRoad(33411, 33411)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
784 |
print(" RemoveRoad(): " + AIRoad.RemoveRoad(33411, 33412)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
785 |
print(" RemoveRoad(): " + AIRoad.RemoveRoad(19590, 19590)); |
10668
495789401303
(svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents:
10650
diff
changeset
|
786 |
print(" IsRoadTypeAvailable(Road): " + AIRoad.IsRoadTypeAvailable(AIRoad.ROADTYPE_ROAD)); |
495789401303
(svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents:
10650
diff
changeset
|
787 |
print(" IsRoadTypeAvailable(Tram): " + AIRoad.IsRoadTypeAvailable(AIRoad.ROADTYPE_TRAM)); |
495789401303
(svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents:
10650
diff
changeset
|
788 |
print(" SetCurrentRoadType(Tram): " + AIRoad.SetCurrentRoadType(AIRoad.ROADTYPE_TRAM)); |
495789401303
(svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents:
10650
diff
changeset
|
789 |
print(" GetCurrentRoadType(): " + AIRoad.GetCurrentRoadType()); |
9485
df09b849ca60
(svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents:
9470
diff
changeset
|
790 |
|
df09b849ca60
(svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents:
9470
diff
changeset
|
791 |
print(" Depot"); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
792 |
print(" IsRoadTile(): " + AIRoad.IsRoadTile(33411)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
793 |
print(" BuildRoadDepot(): " + AIRoad.BuildRoadDepot(0, 1)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
794 |
print(" BuildRoadDepot(): " + AIRoad.BuildRoadDepot(33411, 33411)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
795 |
print(" BuildRoadDepot(): " + AIRoad.BuildRoadDepot(33411, 33414)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
796 |
print(" BuildRoadDepot(): " + AIRoad.BuildRoadDepot(33411, 33412)); |
10668
495789401303
(svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents:
10650
diff
changeset
|
797 |
print(" HasRoadType(Road): " + AIRoad.HasRoadType(33411, AIRoad.ROADTYPE_ROAD)); |
495789401303
(svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents:
10650
diff
changeset
|
798 |
print(" HasRoadType(Tram): " + AIRoad.HasRoadType(33411, AIRoad.ROADTYPE_TRAM)); |
9844
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
9834
diff
changeset
|
799 |
print(" GetLastError(): " + AIError.GetLastError()); |
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
9834
diff
changeset
|
800 |
print(" GetLastErrorString(): " + AIError.GetLastErrorString()); |
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
9834
diff
changeset
|
801 |
print(" GetErrorCategory(): " + AIError.GetErrorCategory()); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
802 |
print(" IsRoadTile(): " + AIRoad.IsRoadTile(33411)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
803 |
print(" GetRoadDepotFrontTile(): " + AIRoad.GetRoadDepotFrontTile(33411)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
804 |
print(" IsRoadDepotTile(): " + AIRoad.IsRoadDepotTile(33411)); |
9769
015b6674c8ad
(svn r12259) [NoAI] -Fix: depots were considered buildable (tnx Progman)
truebrain
parents:
9758
diff
changeset
|
805 |
print(" IsBuildable(): " + AITile.IsBuildable(33411)); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
806 |
print(" RemoveRoadDepot(): " + AIRoad.RemoveRoadDepot(33411)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
807 |
print(" RemoveRoadDepot(): " + AIRoad.RemoveRoadDepot(33411)); |
9485
df09b849ca60
(svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents:
9470
diff
changeset
|
808 |
|
df09b849ca60
(svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents:
9470
diff
changeset
|
809 |
print(" Station"); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
810 |
print(" IsRoadTile(): " + AIRoad.IsRoadTile(33411)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
811 |
print(" BuildRoadStation(): " + AIRoad.BuildRoadStation(0, 1, false, false)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
812 |
print(" BuildRoadStation(): " + AIRoad.BuildRoadStation(33411, 33411, false, false)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
813 |
print(" BuildRoadStation(): " + AIRoad.BuildRoadStation(33411, 33414, false, false)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
814 |
print(" BuildRoadStation(): " + AIRoad.BuildRoadStation(33411, 33412, false, false)); |
10668
495789401303
(svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents:
10650
diff
changeset
|
815 |
print(" HasRoadType(Road): " + AIRoad.HasRoadType(33411, AIRoad.ROADTYPE_ROAD)); |
495789401303
(svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents:
10650
diff
changeset
|
816 |
print(" HasRoadType(Tram): " + AIRoad.HasRoadType(33411, AIRoad.ROADTYPE_TRAM)); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
817 |
print(" IsRoadTile(): " + AIRoad.IsRoadTile(33411)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
818 |
print(" GetDriveThroughBackTile(): " + AIRoad.GetDriveThroughBackTile(33411)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
819 |
print(" GetRoadStationFrontTile(): " + AIRoad.GetRoadStationFrontTile(33411)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
820 |
print(" IsRoadStationTile(): " + AIRoad.IsRoadStationTile(33411)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
821 |
print(" IsDriveThroughRoadStationTile: " + AIRoad.IsDriveThroughRoadStationTile(33411)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
822 |
print(" RemoveRoadStation(): " + AIRoad.RemoveRoadStation(33411)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
823 |
print(" RemoveRoadStation(): " + AIRoad.RemoveRoadStation(33411)); |
9485
df09b849ca60
(svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents:
9470
diff
changeset
|
824 |
|
df09b849ca60
(svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents:
9470
diff
changeset
|
825 |
print(" Station Types"); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
826 |
print(" BuildRoadStation(bus): " + AIRoad.BuildRoadStation(33411, 33410, false, false)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
827 |
print(" BuildRoadStation(truck): " + AIRoad.BuildRoadStation(33421, 33422, true, false)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
828 |
print(" BuildRoadStation(truck): " + AIRoad.BuildRoadStation(33412, 33413, true, false)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
829 |
print(" BuildRoadStation(bus): " + AIRoad.BuildRoadStation(33411 + 256, 33411, false, false)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
830 |
print(" BuildRoadStation(truck): " + AIRoad.BuildRoadStation(33412 + 256, 33412 + 256 + 256, true, false)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
831 |
print(" BuildRoadStation(bus-drive): " + AIRoad.BuildRoadStation(33413, 33412, false, true)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
832 |
print(" BuildRoadStation(truck-drive): " + AIRoad.BuildRoadStation(33414, 33413, true, true)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
833 |
print(" BuildRoadStation(bus-drive): " + AIRoad.BuildRoadStation(33415, 33414, false, true)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
834 |
print(" BuildRoadStation(truck-drive): " + AIRoad.BuildRoadStation(33416, 33415, true, true)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
835 |
print(" BuildRoadDepot(): " + AIRoad.BuildRoadDepot(33417, 33418)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
836 |
print(" GetRoadStationFrontTile(): " + AIRoad.GetRoadStationFrontTile(33411 + 256)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
837 |
print(" GetRoadStationFrontTile(): " + AIRoad.GetRoadStationFrontTile(33412 + 256)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
838 |
print(" IsDriveThroughRoadStationTile: " + AIRoad.IsDriveThroughRoadStationTile(33415)); |
9769
015b6674c8ad
(svn r12259) [NoAI] -Fix: depots were considered buildable (tnx Progman)
truebrain
parents:
9758
diff
changeset
|
839 |
print(" IsBuildable(): " + AITile.IsBuildable(33415)); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
840 |
print(" GetDriveThroughBackTile(): " + AIRoad.GetDriveThroughBackTile(33415)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
841 |
print(" GetRoadStationFrontTile(): " + AIRoad.GetRoadStationFrontTile(33415)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
842 |
print(" IsRoadTile(): " + AIRoad.IsRoadTile(33415)); |
9485
df09b849ca60
(svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents:
9470
diff
changeset
|
843 |
} |
df09b849ca60
(svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents:
9470
diff
changeset
|
844 |
|
9511 | 845 |
function Regression::Sign() |
846 |
{ |
|
847 |
local j = 0; |
|
848 |
||
849 |
print(""); |
|
850 |
print("--Sign--"); |
|
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
851 |
print(" BuildSign(33410, 'Some Sign'): " + AISign.BuildSign(33410, "Some Sign")); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
852 |
local AISign_id = AISign.BuildSign(33409, "Some other Sign"); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
853 |
print(" BuildSign(33409, 'Some other Sign'): " + AISign_id); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
854 |
print(" RemoveSign(" + AISign_id + "): " + AISign.RemoveSign(AISign_id)); |
9511 | 855 |
print(""); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
856 |
print(" GetMaxSignID(): " + AISign.GetMaxSignID()); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
857 |
for (local i = -1; i < AISign.GetMaxSignID() + 1; i++) { |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
858 |
if (AISign.IsValidSign(i)) j++; |
9511 | 859 |
print(" Sign " + i); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
860 |
print(" IsValidSign(): " + AISign.IsValidSign(i)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
861 |
print(" GetText(): " + AISign.GetText(i)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
862 |
print(" GetLocation(): " + AISign.GetLocation(i)); |
10847
6c003b73a276
(svn r13398) [NoAI] -Add: added AISign::GetOwner (on request by Finaldeath)
truebrain
parents:
10844
diff
changeset
|
863 |
print(" GetOwner(): " + AISign.GetOwner(i)); |
10856
c7b29152d594
(svn r13407) [NoAI] -Add: added AICompany::IsMine() to ease up owner-checks (no, not the ones to cash in money)
truebrain
parents:
10852
diff
changeset
|
864 |
print(" IsMine(): " + AICompany.IsMine(AISign.GetOwner(i))); |
9511 | 865 |
} |
866 |
print(" Valid Signs: " + j); |
|
867 |
} |
|
868 |
||
9638
f6d169a5a45a
(svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
9636
diff
changeset
|
869 |
function Regression::Station() |
f6d169a5a45a
(svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
9636
diff
changeset
|
870 |
{ |
f6d169a5a45a
(svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
9636
diff
changeset
|
871 |
print(""); |
f6d169a5a45a
(svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
9636
diff
changeset
|
872 |
print("--Station--"); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
873 |
print(" IsValidStation(0): " + AIStation.IsValidStation(0)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
874 |
print(" IsValidStation(1000): " + AIStation.IsValidStation(1000)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
875 |
print(" GetName(0): " + AIStation.GetName(0)); |
10381
4ad8b98acd82
(svn r12922) [NoAI] -Add: added AIStation::SetName() (Yexo)
truebrain
parents:
10370
diff
changeset
|
876 |
print(" SetName(0): " + AIStation.SetName(0, "Look, a station")); |
4ad8b98acd82
(svn r12922) [NoAI] -Add: added AIStation::SetName() (Yexo)
truebrain
parents:
10370
diff
changeset
|
877 |
print(" GetName(0): " + AIStation.GetName(0)); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
878 |
print(" GetLocation(1): " + AIStation.GetLocation(1)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
879 |
print(" GetLocation(1000): " + AIStation.GetLocation(1000)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
880 |
print(" GetStationID(33411): " + AIStation.GetStationID(33411)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
881 |
print(" GetStationID(34411): " + AIStation.GetStationID(34411)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
882 |
print(" GetCargoWaiting(0, 0): " + AIStation.GetCargoWaiting(0, 0)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
883 |
print(" GetCargoWaiting(1000, 0): " + AIStation.GetCargoWaiting(1000, 0)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
884 |
print(" GetCargoWaiting(0, 1000): " + AIStation.GetCargoWaiting(0, 1000)); |
9638
f6d169a5a45a
(svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
9636
diff
changeset
|
885 |
|
10668
495789401303
(svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents:
10650
diff
changeset
|
886 |
print(" GetStationID(33411): " + AIStation.GetStationID(33411)); |
495789401303
(svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents:
10650
diff
changeset
|
887 |
print(" HasRoadType(3, TRAM): " + AIStation.HasRoadType(3, AIRoad.ROADTYPE_TRAM)); |
495789401303
(svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents:
10650
diff
changeset
|
888 |
print(" HasRoadType(3, ROAD): " + AIStation.HasRoadType(3, AIRoad.ROADTYPE_ROAD)); |
495789401303
(svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents:
10650
diff
changeset
|
889 |
print(" HasRoadType(33411, TRAM): " + AIRoad.HasRoadType(33411, AIRoad.ROADTYPE_TRAM)); |
495789401303
(svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents:
10650
diff
changeset
|
890 |
print(" HasRoadType(33411, ROAD): " + AIRoad.HasRoadType(33411, AIRoad.ROADTYPE_ROAD)); |
10863
7b31d67e1553
(svn r13414) [NoAI] -Add: added AIStation::HasStationType(station_id, station_type) to check if a given station has a given station-type
truebrain
parents:
10859
diff
changeset
|
891 |
print(" HasStationType(3, BUS): " + AIStation.HasStationType(3, AIStation.STATION_BUS_STOP)); |
7b31d67e1553
(svn r13414) [NoAI] -Add: added AIStation::HasStationType(station_id, station_type) to check if a given station has a given station-type
truebrain
parents:
10859
diff
changeset
|
892 |
print(" HasStationType(3, TRAIN): " + AIStation.HasStationType(3, AIStation.STATION_TRAIN)); |
10668
495789401303
(svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents:
10650
diff
changeset
|
893 |
|
10863
7b31d67e1553
(svn r13414) [NoAI] -Add: added AIStation::HasStationType(station_id, station_type) to check if a given station has a given station-type
truebrain
parents:
10859
diff
changeset
|
894 |
print(" GetCoverageRadius(BUS): " + AIStation.GetCoverageRadius(AIStation.STATION_BUS_STOP)); |
7b31d67e1553
(svn r13414) [NoAI] -Add: added AIStation::HasStationType(station_id, station_type) to check if a given station has a given station-type
truebrain
parents:
10859
diff
changeset
|
895 |
print(" GetCoverageRadius(TRUCK): " + AIStation.GetCoverageRadius(AIStation.STATION_TRUCK_STOP)); |
7b31d67e1553
(svn r13414) [NoAI] -Add: added AIStation::HasStationType(station_id, station_type) to check if a given station has a given station-type
truebrain
parents:
10859
diff
changeset
|
896 |
print(" GetCoverageRadius(TRAIN): " + AIStation.GetCoverageRadius(AIStation.STATION_TRAIN)); |
9670
820b77e19bb3
(svn r10609) [NoAI] -Add: added GetAirportWidth / GetAirportHeight
truelight
parents:
9668
diff
changeset
|
897 |
|
820b77e19bb3
(svn r10609) [NoAI] -Add: added GetAirportWidth / GetAirportHeight
truelight
parents:
9668
diff
changeset
|
898 |
local list = AIStationList(AIStation.STATION_BUS_STOP + AIStation.STATION_TRUCK_STOP); |
9638
f6d169a5a45a
(svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
9636
diff
changeset
|
899 |
|
f6d169a5a45a
(svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
9636
diff
changeset
|
900 |
print(""); |
f6d169a5a45a
(svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
9636
diff
changeset
|
901 |
print("--StationList--"); |
f6d169a5a45a
(svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
9636
diff
changeset
|
902 |
print(" Count(): " + list.Count()); |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
903 |
list.Valuate(AIStation.GetLocation); |
9638
f6d169a5a45a
(svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
9636
diff
changeset
|
904 |
print(" Location ListDump:"); |
f6d169a5a45a
(svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
9636
diff
changeset
|
905 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
f6d169a5a45a
(svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
9636
diff
changeset
|
906 |
print(" " + i + " => " + list.GetValue(i)); |
f6d169a5a45a
(svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
9636
diff
changeset
|
907 |
} |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
908 |
list.Valuate(AIStation.GetCargoWaiting, 0); |
9638
f6d169a5a45a
(svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
9636
diff
changeset
|
909 |
print(" CargoWaiting(0) ListDump:"); |
f6d169a5a45a
(svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
9636
diff
changeset
|
910 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
f6d169a5a45a
(svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
9636
diff
changeset
|
911 |
print(" " + i + " => " + list.GetValue(i)); |
f6d169a5a45a
(svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
9636
diff
changeset
|
912 |
} |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
913 |
list.Valuate(AIStation.GetCargoWaiting, 1); |
9638
f6d169a5a45a
(svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
9636
diff
changeset
|
914 |
print(" CargoWaiting(1) ListDump:"); |
f6d169a5a45a
(svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
9636
diff
changeset
|
915 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
f6d169a5a45a
(svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
9636
diff
changeset
|
916 |
print(" " + i + " => " + list.GetValue(i)); |
f6d169a5a45a
(svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
9636
diff
changeset
|
917 |
} |
f6d169a5a45a
(svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
9636
diff
changeset
|
918 |
} |
f6d169a5a45a
(svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
9636
diff
changeset
|
919 |
|
9592
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
9589
diff
changeset
|
920 |
function Regression::TileList() |
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
9589
diff
changeset
|
921 |
{ |
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
9589
diff
changeset
|
922 |
local list = AITileList(); |
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
9589
diff
changeset
|
923 |
|
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
9589
diff
changeset
|
924 |
print(""); |
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
9589
diff
changeset
|
925 |
print("--TileList--"); |
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
9589
diff
changeset
|
926 |
print(" Count(): " + list.Count()); |
10191
da75d1460a4b
(svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents:
10187
diff
changeset
|
927 |
list.AddRectangle(27631 - 256 * 1, 256 * 1 + 27631 + 2); |
da75d1460a4b
(svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents:
10187
diff
changeset
|
928 |
print(" Count(): " + list.Count()); |
da75d1460a4b
(svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents:
10187
diff
changeset
|
929 |
|
da75d1460a4b
(svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents:
10187
diff
changeset
|
930 |
list.Valuate(AITile.GetSlope); |
da75d1460a4b
(svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents:
10187
diff
changeset
|
931 |
print(" Slope(): done"); |
da75d1460a4b
(svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents:
10187
diff
changeset
|
932 |
print(" Count(): " + list.Count()); |
da75d1460a4b
(svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents:
10187
diff
changeset
|
933 |
print(" ListDump:"); |
da75d1460a4b
(svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents:
10187
diff
changeset
|
934 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
da75d1460a4b
(svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents:
10187
diff
changeset
|
935 |
print(" " + i + " => " + list.GetValue(i)); |
da75d1460a4b
(svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents:
10187
diff
changeset
|
936 |
print(" " + i + " => " + AITile.GetComplementSlope(list.GetValue(i))); |
da75d1460a4b
(svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents:
10187
diff
changeset
|
937 |
print(" " + i + " => " + AITile.IsSteepSlope(list.GetValue(i))); |
da75d1460a4b
(svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents:
10187
diff
changeset
|
938 |
print(" " + i + " => " + AITile.IsHalftileSlope(list.GetValue(i))); |
da75d1460a4b
(svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents:
10187
diff
changeset
|
939 |
} |
da75d1460a4b
(svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents:
10187
diff
changeset
|
940 |
list.Clear(); |
da75d1460a4b
(svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents:
10187
diff
changeset
|
941 |
|
da75d1460a4b
(svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents:
10187
diff
changeset
|
942 |
print(""); |
da75d1460a4b
(svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents:
10187
diff
changeset
|
943 |
print("--TileList--"); |
da75d1460a4b
(svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents:
10187
diff
changeset
|
944 |
print(" Count(): " + list.Count()); |
9605
2c2348827b52
(svn r9749) [NoAI] -Add: added regression-test for new AITileList valuators
truelight
parents:
9592
diff
changeset
|
945 |
list.AddRectangle(41895 - 256 * 2, 256 * 2 + 41895 + 8); |
9592
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
9589
diff
changeset
|
946 |
print(" Count(): " + list.Count()); |
9609
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9605
diff
changeset
|
947 |
|
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
948 |
list.Valuate(AITile.GetHeight); |
9700
e442ce398e83
(svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents:
9699
diff
changeset
|
949 |
print(" Height(): done"); |
e442ce398e83
(svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents:
9699
diff
changeset
|
950 |
print(" Count(): " + list.Count()); |
e442ce398e83
(svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents:
9699
diff
changeset
|
951 |
print(" ListDump:"); |
e442ce398e83
(svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents:
9699
diff
changeset
|
952 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
e442ce398e83
(svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents:
9699
diff
changeset
|
953 |
print(" " + i + " => " + list.GetValue(i)); |
e442ce398e83
(svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents:
9699
diff
changeset
|
954 |
} |
e442ce398e83
(svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents:
9699
diff
changeset
|
955 |
|
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
956 |
list.Valuate(AITile.GetSlope); |
9611
5cf58c6571b7
(svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents:
9609
diff
changeset
|
957 |
list.KeepValue(0); |
5cf58c6571b7
(svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents:
9609
diff
changeset
|
958 |
print(" Slope(): done"); |
5cf58c6571b7
(svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents:
9609
diff
changeset
|
959 |
print(" KeepValue(0): done"); |
5cf58c6571b7
(svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents:
9609
diff
changeset
|
960 |
print(" Count(): " + list.Count()); |
5cf58c6571b7
(svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents:
9609
diff
changeset
|
961 |
print(" ListDump:"); |
5cf58c6571b7
(svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents:
9609
diff
changeset
|
962 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
5cf58c6571b7
(svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents:
9609
diff
changeset
|
963 |
print(" " + i + " => " + list.GetValue(i)); |
5cf58c6571b7
(svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents:
9609
diff
changeset
|
964 |
} |
5cf58c6571b7
(svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents:
9609
diff
changeset
|
965 |
|
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
966 |
list.Valuate(AITile.IsBuildable); |
9592
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
9589
diff
changeset
|
967 |
list.KeepValue(1); |
9605
2c2348827b52
(svn r9749) [NoAI] -Add: added regression-test for new AITileList valuators
truelight
parents:
9592
diff
changeset
|
968 |
print(" Buildable(): done"); |
9609
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9605
diff
changeset
|
969 |
print(" KeepValue(1): done"); |
9605
2c2348827b52
(svn r9749) [NoAI] -Add: added regression-test for new AITileList valuators
truelight
parents:
9592
diff
changeset
|
970 |
print(" Count(): " + list.Count()); |
9609
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9605
diff
changeset
|
971 |
|
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
972 |
list.Valuate(AITile.IsBuildableRectangle, 3, 3); |
9657
f2c6e332d8bc
(svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents:
9655
diff
changeset
|
973 |
print(" BuildableRectangle(3, 3) ListDump:"); |
f2c6e332d8bc
(svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents:
9655
diff
changeset
|
974 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
f2c6e332d8bc
(svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents:
9655
diff
changeset
|
975 |
print(" " + i + " => " + list.GetValue(i)); |
f2c6e332d8bc
(svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents:
9655
diff
changeset
|
976 |
} |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
977 |
list.Valuate(AITile.GetDistanceManhattanToTile, 30000); |
9655
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9654
diff
changeset
|
978 |
print(" DistanceManhattanToTile(30000) ListDump:"); |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9654
diff
changeset
|
979 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9654
diff
changeset
|
980 |
print(" " + i + " => " + list.GetValue(i)); |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9654
diff
changeset
|
981 |
} |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
982 |
list.Valuate(AITile.GetDistanceSquareToTile, 30000); |
9655
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9654
diff
changeset
|
983 |
print(" DistanceSquareToTile(30000) ListDump:"); |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9654
diff
changeset
|
984 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9654
diff
changeset
|
985 |
print(" " + i + " => " + list.GetValue(i)); |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9654
diff
changeset
|
986 |
} |
10360
3234cb59de55
(svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents:
10344
diff
changeset
|
987 |
list.Valuate(AITile.GetOwner); |
3234cb59de55
(svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents:
10344
diff
changeset
|
988 |
print(" GetOwner() ListDump:"); |
3234cb59de55
(svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents:
10344
diff
changeset
|
989 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
3234cb59de55
(svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents:
10344
diff
changeset
|
990 |
print(" " + i + " => " + list.GetValue(i)); |
3234cb59de55
(svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents:
10344
diff
changeset
|
991 |
} |
9655
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9654
diff
changeset
|
992 |
|
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
993 |
list.Valuate(AITile.GetCargoAcceptance, 0, 1, 1, 3); |
9609
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9605
diff
changeset
|
994 |
list.KeepAboveValue(10); |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9605
diff
changeset
|
995 |
print(" CargoAcceptance(): done"); |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9605
diff
changeset
|
996 |
print(" KeepAboveValue(10): done"); |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9605
diff
changeset
|
997 |
print(" Count(): " + list.Count()); |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9605
diff
changeset
|
998 |
print(" ListDump:"); |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9605
diff
changeset
|
999 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9605
diff
changeset
|
1000 |
print(" " + i + " => " + list.GetValue(i)); |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9605
diff
changeset
|
1001 |
} |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9605
diff
changeset
|
1002 |
|
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
1003 |
list.Valuate(AIRoad.IsRoadTile); |
9605
2c2348827b52
(svn r9749) [NoAI] -Add: added regression-test for new AITileList valuators
truelight
parents:
9592
diff
changeset
|
1004 |
list.KeepValue(1); |
2c2348827b52
(svn r9749) [NoAI] -Add: added regression-test for new AITileList valuators
truelight
parents:
9592
diff
changeset
|
1005 |
print(" RoadTile(): done"); |
9609
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9605
diff
changeset
|
1006 |
print(" KeepValue(1): done"); |
9605
2c2348827b52
(svn r9749) [NoAI] -Add: added regression-test for new AITileList valuators
truelight
parents:
9592
diff
changeset
|
1007 |
print(" Count(): " + list.Count()); |
9609
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9605
diff
changeset
|
1008 |
print(" ListDump:"); |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9605
diff
changeset
|
1009 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9605
diff
changeset
|
1010 |
print(" " + i + " => " + list.GetValue(i)); |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9605
diff
changeset
|
1011 |
} |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9605
diff
changeset
|
1012 |
|
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
1013 |
list.Valuate(AIRoad.GetNeighbourRoadCount); |
9605
2c2348827b52
(svn r9749) [NoAI] -Add: added regression-test for new AITileList valuators
truelight
parents:
9592
diff
changeset
|
1014 |
list.KeepValue(1); |
9617
df9cedf12aab
(svn r9786) [NoAI] -Fix: NeighbourRoad -> NeighbourRoadCount
truelight
parents:
9616
diff
changeset
|
1015 |
print(" NeighbourRoadCount():done"); |
9609
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9605
diff
changeset
|
1016 |
print(" KeepValue(1): done"); |
9592
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
9589
diff
changeset
|
1017 |
print(" Count(): " + list.Count()); |
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
9589
diff
changeset
|
1018 |
print(" ListDump:"); |
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
9589
diff
changeset
|
1019 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
9589
diff
changeset
|
1020 |
print(" " + i + " => " + list.GetValue(i)); |
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
9589
diff
changeset
|
1021 |
} |
9698
1d50fe99b7e9
(svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents:
9696
diff
changeset
|
1022 |
|
1d50fe99b7e9
(svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents:
9696
diff
changeset
|
1023 |
list.AddRectangle(54421 - 256 * 2, 256 * 2 + 54421 + 8); |
10931
df70e29d4c23
(svn r13484) [NoAI] -Fix [API CHANGE]: AITile::IsBuildable() now returns 'true' on coast tiles
truebrain
parents:
10918
diff
changeset
|
1024 |
list.Valuate(AITile.IsWaterTile); |
9698
1d50fe99b7e9
(svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents:
9696
diff
changeset
|
1025 |
print(" Water(): done"); |
1d50fe99b7e9
(svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents:
9696
diff
changeset
|
1026 |
print(" Count(): " + list.Count()); |
1d50fe99b7e9
(svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents:
9696
diff
changeset
|
1027 |
print(" ListDump:"); |
1d50fe99b7e9
(svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents:
9696
diff
changeset
|
1028 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
1d50fe99b7e9
(svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents:
9696
diff
changeset
|
1029 |
print(" " + i + " => " + list.GetValue(i)); |
1d50fe99b7e9
(svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents:
9696
diff
changeset
|
1030 |
} |
9758
f01f3df7cfbe
(svn r12243) [NoAI] -Fix r12242: move the regression-test for AITileList_Industry* to TileList(), and show that they really work by using the Valuators to proof that
truebrain
parents:
9757
diff
changeset
|
1031 |
|
f01f3df7cfbe
(svn r12243) [NoAI] -Fix r12242: move the regression-test for AITileList_Industry* to TileList(), and show that they really work by using the Valuators to proof that
truebrain
parents:
9757
diff
changeset
|
1032 |
local list = AITileList_IndustryAccepting(0, 3); |
f01f3df7cfbe
(svn r12243) [NoAI] -Fix r12242: move the regression-test for AITileList_Industry* to TileList(), and show that they really work by using the Valuators to proof that
truebrain
parents:
9757
diff
changeset
|
1033 |
print(""); |
f01f3df7cfbe
(svn r12243) [NoAI] -Fix r12242: move the regression-test for AITileList_Industry* to TileList(), and show that they really work by using the Valuators to proof that
truebrain
parents:
9757
diff
changeset
|
1034 |
print("--TileList_IndustryAccepting--"); |
f01f3df7cfbe
(svn r12243) [NoAI] -Fix r12242: move the regression-test for AITileList_Industry* to TileList(), and show that they really work by using the Valuators to proof that
truebrain
parents:
9757
diff
changeset
|
1035 |
print(" Count(): " + list.Count()); |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
1036 |
list.Valuate(AITile.GetCargoAcceptance, 3, 1, 1, 3); |
9758
f01f3df7cfbe
(svn r12243) [NoAI] -Fix r12242: move the regression-test for AITileList_Industry* to TileList(), and show that they really work by using the Valuators to proof that
truebrain
parents:
9757
diff
changeset
|
1037 |
print(" Location ListDump:"); |
f01f3df7cfbe
(svn r12243) [NoAI] -Fix r12242: move the regression-test for AITileList_Industry* to TileList(), and show that they really work by using the Valuators to proof that
truebrain
parents:
9757
diff
changeset
|
1038 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
f01f3df7cfbe
(svn r12243) [NoAI] -Fix r12242: move the regression-test for AITileList_Industry* to TileList(), and show that they really work by using the Valuators to proof that
truebrain
parents:
9757
diff
changeset
|
1039 |
print(" " + i + " => " + list.GetValue(i)); |
f01f3df7cfbe
(svn r12243) [NoAI] -Fix r12242: move the regression-test for AITileList_Industry* to TileList(), and show that they really work by using the Valuators to proof that
truebrain
parents:
9757
diff
changeset
|
1040 |
} |
f01f3df7cfbe
(svn r12243) [NoAI] -Fix r12242: move the regression-test for AITileList_Industry* to TileList(), and show that they really work by using the Valuators to proof that
truebrain
parents:
9757
diff
changeset
|
1041 |
|
f01f3df7cfbe
(svn r12243) [NoAI] -Fix r12242: move the regression-test for AITileList_Industry* to TileList(), and show that they really work by using the Valuators to proof that
truebrain
parents:
9757
diff
changeset
|
1042 |
local list = AITileList_IndustryProducing(1, 3); |
f01f3df7cfbe
(svn r12243) [NoAI] -Fix r12242: move the regression-test for AITileList_Industry* to TileList(), and show that they really work by using the Valuators to proof that
truebrain
parents:
9757
diff
changeset
|
1043 |
print(""); |
f01f3df7cfbe
(svn r12243) [NoAI] -Fix r12242: move the regression-test for AITileList_Industry* to TileList(), and show that they really work by using the Valuators to proof that
truebrain
parents:
9757
diff
changeset
|
1044 |
print("--TileList_IndustryProducing--"); |
f01f3df7cfbe
(svn r12243) [NoAI] -Fix r12242: move the regression-test for AITileList_Industry* to TileList(), and show that they really work by using the Valuators to proof that
truebrain
parents:
9757
diff
changeset
|
1045 |
print(" Count(): " + list.Count()); |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
1046 |
list.Valuate(AITile.GetCargoProduction, 7, 1, 1, 3); |
9758
f01f3df7cfbe
(svn r12243) [NoAI] -Fix r12242: move the regression-test for AITileList_Industry* to TileList(), and show that they really work by using the Valuators to proof that
truebrain
parents:
9757
diff
changeset
|
1047 |
print(" Location ListDump:"); |
f01f3df7cfbe
(svn r12243) [NoAI] -Fix r12242: move the regression-test for AITileList_Industry* to TileList(), and show that they really work by using the Valuators to proof that
truebrain
parents:
9757
diff
changeset
|
1048 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
f01f3df7cfbe
(svn r12243) [NoAI] -Fix r12242: move the regression-test for AITileList_Industry* to TileList(), and show that they really work by using the Valuators to proof that
truebrain
parents:
9757
diff
changeset
|
1049 |
print(" " + i + " => " + list.GetValue(i)); |
f01f3df7cfbe
(svn r12243) [NoAI] -Fix r12242: move the regression-test for AITileList_Industry* to TileList(), and show that they really work by using the Valuators to proof that
truebrain
parents:
9757
diff
changeset
|
1050 |
} |
10864
9a6616a1dce6
(svn r13415) [NoAI] -Add: added AITileList_StationType, giving all the tiles on which a station of your requested type is, for a given station
truebrain
parents:
10863
diff
changeset
|
1051 |
|
9a6616a1dce6
(svn r13415) [NoAI] -Add: added AITileList_StationType, giving all the tiles on which a station of your requested type is, for a given station
truebrain
parents:
10863
diff
changeset
|
1052 |
local list = AITileList_StationType(3, AIStation.STATION_BUS_STOP); |
9a6616a1dce6
(svn r13415) [NoAI] -Add: added AITileList_StationType, giving all the tiles on which a station of your requested type is, for a given station
truebrain
parents:
10863
diff
changeset
|
1053 |
print(""); |
9a6616a1dce6
(svn r13415) [NoAI] -Add: added AITileList_StationType, giving all the tiles on which a station of your requested type is, for a given station
truebrain
parents:
10863
diff
changeset
|
1054 |
print("--TileList_StationType--"); |
9a6616a1dce6
(svn r13415) [NoAI] -Add: added AITileList_StationType, giving all the tiles on which a station of your requested type is, for a given station
truebrain
parents:
10863
diff
changeset
|
1055 |
print(" Count(): " + list.Count()); |
9a6616a1dce6
(svn r13415) [NoAI] -Add: added AITileList_StationType, giving all the tiles on which a station of your requested type is, for a given station
truebrain
parents:
10863
diff
changeset
|
1056 |
print(" Location ListDump:"); |
9a6616a1dce6
(svn r13415) [NoAI] -Add: added AITileList_StationType, giving all the tiles on which a station of your requested type is, for a given station
truebrain
parents:
10863
diff
changeset
|
1057 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
9a6616a1dce6
(svn r13415) [NoAI] -Add: added AITileList_StationType, giving all the tiles on which a station of your requested type is, for a given station
truebrain
parents:
10863
diff
changeset
|
1058 |
print(" " + i + " => " + list.GetValue(i)); |
9a6616a1dce6
(svn r13415) [NoAI] -Add: added AITileList_StationType, giving all the tiles on which a station of your requested type is, for a given station
truebrain
parents:
10863
diff
changeset
|
1059 |
} |
9592
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
9589
diff
changeset
|
1060 |
} |
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
9589
diff
changeset
|
1061 |
|
9460
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
1062 |
function Regression::Town() |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
1063 |
{ |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
1064 |
local j = 0; |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
1065 |
|
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
1066 |
print(""); |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
1067 |
print("--Town--"); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1068 |
print(" GetMaxTownID(): " + AITown.GetMaxTownID()); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1069 |
print(" GetTownCount(): " + AITown.GetTownCount()); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1070 |
for (local i = -1; i < AITown.GetMaxTownID() + 1; i++) { |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1071 |
if (AITown.IsValidTown(i)) j++; |
9460
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
1072 |
print(" Town " + i); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1073 |
print(" IsValidTown(): " + AITown.IsValidTown(i)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1074 |
print(" GetName(): " + AITown.GetName(i)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1075 |
print(" GetPopulation(): " + AITown.GetPopulation(i)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1076 |
print(" GetLocation(): " + AITown.GetLocation(i)); |
10844
affb2821fb9f
(svn r13395) [NoAI] -Fix [API CHANGE]: Rename AIOrder::GetNumberOfORders to AIOrder::GetOrderCount
truebrain
parents:
10831
diff
changeset
|
1077 |
print(" GetHouseCount(): " + AITown.GetHouseCount(i)); |
10869
4fdb11e1b599
(svn r13420) [NoAI] -Add: function to get the town rating.
rubidium
parents:
10864
diff
changeset
|
1078 |
print(" GetRating(): " + AITown.GetRating(i, AICompany.MY_COMPANY)); |
9460
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
1079 |
} |
9511 | 1080 |
print(" Valid Towns: " + j); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1081 |
print(" GetTownCount(): " + AITown.GetTownCount()); |
9460
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
1082 |
} |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
1083 |
|
9589
2fbda08db406
(svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
9585
diff
changeset
|
1084 |
function Regression::TownList() |
2fbda08db406
(svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
9585
diff
changeset
|
1085 |
{ |
2fbda08db406
(svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
9585
diff
changeset
|
1086 |
local list = AITownList(); |
2fbda08db406
(svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
9585
diff
changeset
|
1087 |
|
2fbda08db406
(svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
9585
diff
changeset
|
1088 |
print(""); |
2fbda08db406
(svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
9585
diff
changeset
|
1089 |
print("--TownList--"); |
2fbda08db406
(svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
9585
diff
changeset
|
1090 |
print(" Count(): " + list.Count()); |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
1091 |
list.Valuate(AITown.GetLocation); |
9649
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
1092 |
print(" Location ListDump:"); |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
1093 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
1094 |
print(" " + i + " => " + list.GetValue(i)); |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
1095 |
} |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
1096 |
list.Valuate(AITown.GetDistanceManhattanToTile, 30000); |
9655
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9654
diff
changeset
|
1097 |
print(" DistanceManhattanToTile(30000) ListDump:"); |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9654
diff
changeset
|
1098 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9654
diff
changeset
|
1099 |
print(" " + i + " => " + list.GetValue(i)); |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9654
diff
changeset
|
1100 |
} |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
1101 |
list.Valuate(AITown.GetDistanceSquareToTile, 30000); |
9655
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9654
diff
changeset
|
1102 |
print(" DistanceSquareToTile(30000) ListDump:"); |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9654
diff
changeset
|
1103 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9654
diff
changeset
|
1104 |
print(" " + i + " => " + list.GetValue(i)); |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9654
diff
changeset
|
1105 |
} |
10361
4cdffd48480f
(svn r12902) [NoAI] -Fix r12901 [API CHANGE]: renamed IsWithinTownRadius to IsWithinTownInfluence, as that reflects the meaning much better
truebrain
parents:
10360
diff
changeset
|
1106 |
list.Valuate(AITown.IsWithinTownInfluence, AITown.GetLocation(0)); |
4cdffd48480f
(svn r12902) [NoAI] -Fix r12901 [API CHANGE]: renamed IsWithinTownRadius to IsWithinTownInfluence, as that reflects the meaning much better
truebrain
parents:
10360
diff
changeset
|
1107 |
print(" IsWithinTownInfluence(" + AITown.GetLocation(0) + ") ListDump:"); |
10360
3234cb59de55
(svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents:
10344
diff
changeset
|
1108 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
3234cb59de55
(svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents:
10344
diff
changeset
|
1109 |
print(" " + i + " => " + list.GetValue(i)); |
3234cb59de55
(svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents:
10344
diff
changeset
|
1110 |
} |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
1111 |
list.Valuate(AITown.GetPopulation); |
9589
2fbda08db406
(svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
9585
diff
changeset
|
1112 |
list.KeepAboveValue(500); |
2fbda08db406
(svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
9585
diff
changeset
|
1113 |
print(" KeepAboveValue(500): done"); |
2fbda08db406
(svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
9585
diff
changeset
|
1114 |
print(" Count(): " + list.Count()); |
9649
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
1115 |
print(" Population ListDump:"); |
9589
2fbda08db406
(svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
9585
diff
changeset
|
1116 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
2fbda08db406
(svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
9585
diff
changeset
|
1117 |
print(" " + i + " => " + list.GetValue(i)); |
2fbda08db406
(svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
9585
diff
changeset
|
1118 |
} |
10859
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10856
diff
changeset
|
1119 |
|
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10856
diff
changeset
|
1120 |
print(" HasStatue(): " + AITown.HasStatue(list.Begin())); |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10856
diff
changeset
|
1121 |
print(" GetRoadReworkDuration(): " + AITown.GetRoadReworkDuration(list.Begin())); |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10856
diff
changeset
|
1122 |
print(" GetExclusiveRightsPlayer(): " + AITown.GetExclusiveRightsPlayer(list.Begin())); |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10856
diff
changeset
|
1123 |
print(" GetExclusiveRightsDuration(): " + AITown.GetExclusiveRightsDuration(list.Begin())); |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10856
diff
changeset
|
1124 |
print(" IsActionAvailable(BUILD_STATUE): " + AITown.IsActionAvailable(list.Begin(), AITown.TOWN_ACTION_BUILD_STATUE)); |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10856
diff
changeset
|
1125 |
print(" PerformTownAction(BUILD_STATUE): " + AITown.PerformTownAction(list.Begin(), AITown.TOWN_ACTION_BUILD_STATUE)); |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10856
diff
changeset
|
1126 |
print(" IsActionAvailable(BUILD_STATUE): " + AITown.IsActionAvailable(list.Begin(), AITown.TOWN_ACTION_BUILD_STATUE)); |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10856
diff
changeset
|
1127 |
print(" HasStatue(): " + AITown.HasStatue(list.Begin())); |
9589
2fbda08db406
(svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
9585
diff
changeset
|
1128 |
} |
2fbda08db406
(svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
9585
diff
changeset
|
1129 |
|
9794
5d866d7cb991
(svn r12298) [NoAI] -Add: added AITunnel (Morloth)
truebrain
parents:
9793
diff
changeset
|
1130 |
function Regression::Tunnel() |
5d866d7cb991
(svn r12298) [NoAI] -Add: added AITunnel (Morloth)
truebrain
parents:
9793
diff
changeset
|
1131 |
{ |
10859
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10856
diff
changeset
|
1132 |
print(""); |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10856
diff
changeset
|
1133 |
print("--Tunnel--"); |
9794
5d866d7cb991
(svn r12298) [NoAI] -Add: added AITunnel (Morloth)
truebrain
parents:
9793
diff
changeset
|
1134 |
print(" IsTunnelTile(): " + AITunnel.IsTunnelTile(29050)); |
5d866d7cb991
(svn r12298) [NoAI] -Add: added AITunnel (Morloth)
truebrain
parents:
9793
diff
changeset
|
1135 |
print(" RemoveTunnel(): " + AITunnel.RemoveTunnel(29050)); |
9807
5b3be41b3ce6
(svn r12315) [NoAI] -Fix: AITunnel::GetOtherTunnelEnd() now also works to estimate where a non-existing tunnel would end (Morloth / glx)
truebrain
parents:
9806
diff
changeset
|
1136 |
print(" GetOtherTunnelEnd(): " + AITunnel.GetOtherTunnelEnd(29050)); |
9794
5d866d7cb991
(svn r12298) [NoAI] -Add: added AITunnel (Morloth)
truebrain
parents:
9793
diff
changeset
|
1137 |
print(" BuildTunnel(): " + AITunnel.BuildTunnel(AIVehicle.VEHICLE_ROAD, 29050)); |
9807
5b3be41b3ce6
(svn r12315) [NoAI] -Fix: AITunnel::GetOtherTunnelEnd() now also works to estimate where a non-existing tunnel would end (Morloth / glx)
truebrain
parents:
9806
diff
changeset
|
1138 |
print(" GetOtherTunnelEnd(): " + AITunnel.GetOtherTunnelEnd(29050)); |
9794
5d866d7cb991
(svn r12298) [NoAI] -Add: added AITunnel (Morloth)
truebrain
parents:
9793
diff
changeset
|
1139 |
print(" IsTunnelTile(): " + AITunnel.IsTunnelTile(29050)); |
9807
5b3be41b3ce6
(svn r12315) [NoAI] -Fix: AITunnel::GetOtherTunnelEnd() now also works to estimate where a non-existing tunnel would end (Morloth / glx)
truebrain
parents:
9806
diff
changeset
|
1140 |
print(" IsTunnelTile(): " + AITunnel.IsTunnelTile(28026)); |
9794
5d866d7cb991
(svn r12298) [NoAI] -Add: added AITunnel (Morloth)
truebrain
parents:
9793
diff
changeset
|
1141 |
print(" RemoveTunnel(): " + AITunnel.RemoveTunnel(29050)); |
5d866d7cb991
(svn r12298) [NoAI] -Add: added AITunnel (Morloth)
truebrain
parents:
9793
diff
changeset
|
1142 |
print(" IsTunnelTile(): " + AITunnel.IsTunnelTile(29050)); |
10088
922c6e6a8d3e
(svn r12612) [NoAI] -Add: support for GetLastError for AITunnel. Patch by Morloth.
rubidium
parents:
10086
diff
changeset
|
1143 |
|
922c6e6a8d3e
(svn r12612) [NoAI] -Add: support for GetLastError for AITunnel. Patch by Morloth.
rubidium
parents:
10086
diff
changeset
|
1144 |
print(" --Errors--"); |
922c6e6a8d3e
(svn r12612) [NoAI] -Add: support for GetLastError for AITunnel. Patch by Morloth.
rubidium
parents:
10086
diff
changeset
|
1145 |
print(" BuildTunnel(): " + AITunnel.BuildTunnel(AIVehicle.VEHICLE_ROAD, 7529)); |
922c6e6a8d3e
(svn r12612) [NoAI] -Add: support for GetLastError for AITunnel. Patch by Morloth.
rubidium
parents:
10086
diff
changeset
|
1146 |
print(" BuildTunnel(): " + AITunnel.BuildTunnel(AIVehicle.VEHICLE_ROAD, 8043)); |
922c6e6a8d3e
(svn r12612) [NoAI] -Add: support for GetLastError for AITunnel. Patch by Morloth.
rubidium
parents:
10086
diff
changeset
|
1147 |
print(" GetLastErrorString(): " + AIError.GetLastErrorString()); |
922c6e6a8d3e
(svn r12612) [NoAI] -Add: support for GetLastError for AITunnel. Patch by Morloth.
rubidium
parents:
10086
diff
changeset
|
1148 |
print(" RemoveTunnel(): " + AITunnel.RemoveTunnel(7529)); |
9794
5d866d7cb991
(svn r12298) [NoAI] -Add: added AITunnel (Morloth)
truebrain
parents:
9793
diff
changeset
|
1149 |
} |
5d866d7cb991
(svn r12298) [NoAI] -Add: added AITunnel (Morloth)
truebrain
parents:
9793
diff
changeset
|
1150 |
|
9518
b32191854ad9
(svn r9432) [NoAI] -Add: added regression-test for AIVehicle()
truelight
parents:
9511
diff
changeset
|
1151 |
function Regression::Vehicle() |
b32191854ad9
(svn r9432) [NoAI] -Add: added regression-test for AIVehicle()
truelight
parents:
9511
diff
changeset
|
1152 |
{ |
9557
a3e1a25cf3d3
(svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents:
9555
diff
changeset
|
1153 |
local accounting = AIAccounting(); |
9518
b32191854ad9
(svn r9432) [NoAI] -Add: added regression-test for AIVehicle()
truelight
parents:
9511
diff
changeset
|
1154 |
|
b32191854ad9
(svn r9432) [NoAI] -Add: added regression-test for AIVehicle()
truelight
parents:
9511
diff
changeset
|
1155 |
print(""); |
b32191854ad9
(svn r9432) [NoAI] -Add: added regression-test for AIVehicle()
truelight
parents:
9511
diff
changeset
|
1156 |
print("--Vehicle--"); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1157 |
print(" IsValidVehicle(-1): " + AIVehicle.IsValidVehicle(-1)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1158 |
print(" IsValidVehicle(0): " + AIVehicle.IsValidVehicle(0)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1159 |
print(" IsValidVehicle(11): " + AIVehicle.IsValidVehicle(11)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1160 |
print(" ISValidVehicle(9999): " + AIVehicle.IsValidVehicle(9999)); |
9518
b32191854ad9
(svn r9432) [NoAI] -Add: added regression-test for AIVehicle()
truelight
parents:
9511
diff
changeset
|
1161 |
|
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1162 |
local bank = AICompany.GetBankBalance(AICompany.MY_COMPANY); |
9557
a3e1a25cf3d3
(svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents:
9555
diff
changeset
|
1163 |
|
9560
ff2dde050a4c
(svn r9498) [NoAI] -Add: added regression for AITransactionMode()
truelight
parents:
9558
diff
changeset
|
1164 |
{ |
ff2dde050a4c
(svn r9498) [NoAI] -Add: added regression for AITransactionMode()
truelight
parents:
9558
diff
changeset
|
1165 |
local transaction = AITransactionMode(); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1166 |
print(" BuildVehicle(): " + AIVehicle.BuildVehicle(33417, 153)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1167 |
print(" IsValidVehicle(11): " + AIVehicle.IsValidVehicle(11)); |
9560
ff2dde050a4c
(svn r9498) [NoAI] -Add: added regression for AITransactionMode()
truelight
parents:
9558
diff
changeset
|
1168 |
|
ff2dde050a4c
(svn r9498) [NoAI] -Add: added regression for AITransactionMode()
truelight
parents:
9558
diff
changeset
|
1169 |
print(" --Transaction--"); |
ff2dde050a4c
(svn r9498) [NoAI] -Add: added regression for AITransactionMode()
truelight
parents:
9558
diff
changeset
|
1170 |
print(" GetCosts(): " + transaction.GetCosts()); |
ff2dde050a4c
(svn r9498) [NoAI] -Add: added regression for AITransactionMode()
truelight
parents:
9558
diff
changeset
|
1171 |
print(" Execute(): " + transaction.Execute()); |
ff2dde050a4c
(svn r9498) [NoAI] -Add: added regression for AITransactionMode()
truelight
parents:
9558
diff
changeset
|
1172 |
|
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1173 |
print(" IsValidVehicle(11): " + AIVehicle.IsValidVehicle(11)); |
9560
ff2dde050a4c
(svn r9498) [NoAI] -Add: added regression for AITransactionMode()
truelight
parents:
9558
diff
changeset
|
1174 |
} |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1175 |
print(" CloneVehicle(): " + AIVehicle.CloneVehicle(33417, 11, true)); |
9557
a3e1a25cf3d3
(svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents:
9555
diff
changeset
|
1176 |
|
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1177 |
local bank_after = AICompany.GetBankBalance(AICompany.MY_COMPANY); |
9557
a3e1a25cf3d3
(svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents:
9555
diff
changeset
|
1178 |
|
a3e1a25cf3d3
(svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents:
9555
diff
changeset
|
1179 |
print(" --Accounting--"); |
a3e1a25cf3d3
(svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents:
9555
diff
changeset
|
1180 |
print(" GetCosts(): " + accounting.GetCosts()); |
a3e1a25cf3d3
(svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents:
9555
diff
changeset
|
1181 |
print(" Should be: " + (bank - bank_after)); |
a3e1a25cf3d3
(svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents:
9555
diff
changeset
|
1182 |
print(" ResetCosts(): " + accounting.ResetCosts()); |
a3e1a25cf3d3
(svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents:
9555
diff
changeset
|
1183 |
|
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1184 |
bank = AICompany.GetBankBalance(AICompany.MY_COMPANY); |
9557
a3e1a25cf3d3
(svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents:
9555
diff
changeset
|
1185 |
|
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1186 |
print(" SellVehicle(12): " + AIVehicle.SellVehicle(12)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1187 |
print(" IsInDepot(): " + AIVehicle.IsInDepot(11)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1188 |
print(" IsStoppedInDepot(): " + AIVehicle.IsStoppedInDepot(11)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1189 |
print(" StartStopVehicle(): " + AIVehicle.StartStopVehicle(11)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1190 |
print(" IsInDepot(): " + AIVehicle.IsInDepot(11)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1191 |
print(" IsStoppedInDepot(): " + AIVehicle.IsStoppedInDepot(11)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1192 |
print(" SendVehicleToDepot(): " + AIVehicle.SendVehicleToDepot(11)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1193 |
print(" IsInDepot(): " + AIVehicle.IsInDepot(11)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1194 |
print(" IsStoppedInDepot(): " + AIVehicle.IsStoppedInDepot(11)); |
9557
a3e1a25cf3d3
(svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents:
9555
diff
changeset
|
1195 |
|
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1196 |
bank_after = AICompany.GetBankBalance(AICompany.MY_COMPANY); |
9557
a3e1a25cf3d3
(svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents:
9555
diff
changeset
|
1197 |
|
a3e1a25cf3d3
(svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents:
9555
diff
changeset
|
1198 |
print(" --Accounting--"); |
a3e1a25cf3d3
(svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents:
9555
diff
changeset
|
1199 |
print(" GetCosts(): " + accounting.GetCosts()); |
a3e1a25cf3d3
(svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents:
9555
diff
changeset
|
1200 |
print(" Should be: " + (bank - bank_after)); |
a3e1a25cf3d3
(svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents:
9555
diff
changeset
|
1201 |
|
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1202 |
print(" GetName(): " + AIVehicle.GetName(11)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1203 |
print(" SetName(): " + AIVehicle.SetName(11, "MyVehicleName")); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1204 |
print(" GetName(): " + AIVehicle.GetName(11)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1205 |
print(" CloneVehicle(): " + AIVehicle.CloneVehicle(33417, 11, true)); |
9614
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
1206 |
|
9615
f809cdc8e360
(svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents:
9614
diff
changeset
|
1207 |
print(" --VehicleData--"); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1208 |
print(" GetLocation(): " + AIVehicle.GetLocation(11)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1209 |
print(" GetEngineType(): " + AIVehicle.GetEngineType(11)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1210 |
print(" GetUnitNumber(): " + AIVehicle.GetUnitNumber(11)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1211 |
print(" GetAge(): " + AIVehicle.GetAge(11)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1212 |
print(" GetMaxAge(): " + AIVehicle.GetMaxAge(11)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1213 |
print(" GetAgeLeft(): " + AIVehicle.GetAgeLeft(11)); |
10187
d5a6eba5af45
(svn r12718) [NoAI] -Add: added AIVehicle::GetCurrentSpeed
truebrain
parents:
10088
diff
changeset
|
1214 |
print(" GetCurrentSpeed(): " + AIVehicle.GetCurrentSpeed(11)); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1215 |
print(" GetRunningCost(): " + AIVehicle.GetRunningCost(11)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1216 |
print(" GetProfitThisYear(): " + AIVehicle.GetProfitThisYear(11)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1217 |
print(" GetProfitLastYear(): " + AIVehicle.GetProfitLastYear(11)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1218 |
print(" GetVehicleType(): " + AIVehicle.GetVehicleType(11)); |
10668
495789401303
(svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents:
10650
diff
changeset
|
1219 |
print(" GetRoadType(): " + AIVehicle.GetRoadType(11)); |
10193
9f73edc0c57a
(svn r12724) [NoAI] -Fix r12720: also add regression test for new functions
truebrain
parents:
10191
diff
changeset
|
1220 |
print(" GetCapacity(): " + AIVehicle.GetCapacity(11, 10)); |
9f73edc0c57a
(svn r12724) [NoAI] -Fix r12720: also add regression test for new functions
truebrain
parents:
10191
diff
changeset
|
1221 |
print(" GetCargoLoad(): " + AIVehicle.GetCargoLoad(11, 10)); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1222 |
print(" IsInDepot(): " + AIVehicle.IsInDepot(11)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1223 |
print(" IsStoppedInDepot(): " + AIVehicle.IsStoppedInDepot(11)); |
9615
f809cdc8e360
(svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents:
9614
diff
changeset
|
1224 |
|
10360
3234cb59de55
(svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents:
10344
diff
changeset
|
1225 |
print(" GetOwner(): " + AITile.GetOwner(32119)); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1226 |
print(" BuildVehicle(): " + AIVehicle.BuildVehicle(32119, 219)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1227 |
print(" IsValidVehicle(13): " + AIVehicle.IsValidVehicle(13)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1228 |
print(" IsInDepot(13): " + AIVehicle.IsInDepot(13)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1229 |
print(" IsStoppedInDepot(13): " + AIVehicle.IsStoppedInDepot(13)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1230 |
print(" IsValidVehicle(14): " + AIVehicle.IsValidVehicle(14)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1231 |
print(" IsInDepot(14): " + AIVehicle.IsInDepot(14)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1232 |
print(" IsStoppedInDepot(14): " + AIVehicle.IsStoppedInDepot(14)); |
9691
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
9684
diff
changeset
|
1233 |
|
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1234 |
print(" BuildVehicle(): " + AIVehicle.BuildVehicle(28479, 204)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1235 |
print(" IsValidVehicle(15): " + AIVehicle.IsValidVehicle(15)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1236 |
print(" IsInDepot(15): " + AIVehicle.IsInDepot(15)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
1237 |
print(" IsStoppedInDepot(15): " + AIVehicle.IsStoppedInDepot(15)); |
9654
b836eb5c521f
(svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
9652
diff
changeset
|
1238 |
|
9874
4ecef0dadf01
(svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents:
9867
diff
changeset
|
1239 |
print(" --Errors--"); |
4ecef0dadf01
(svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents:
9867
diff
changeset
|
1240 |
print(" RefitVehicle(): " + AIVehicle.RefitVehicle(11, 0)); |
4ecef0dadf01
(svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents:
9867
diff
changeset
|
1241 |
print(" GetLastErrorString(): " + AIError.GetLastErrorString()); |
4ecef0dadf01
(svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents:
9867
diff
changeset
|
1242 |
print(" SellVehicle(): " + AIVehicle.SellVehicle(11)); |
4ecef0dadf01
(svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents:
9867
diff
changeset
|
1243 |
print(" GetLastErrorString(): " + AIError.GetLastErrorString()); |
4ecef0dadf01
(svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents:
9867
diff
changeset
|
1244 |
print(" SendVehicleToDepot(): " + AIVehicle.SendVehicleToDepot(12)); |
4ecef0dadf01
(svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents:
9867
diff
changeset
|
1245 |
print(" GetLastErrorString(): " + AIError.GetLastErrorString()); |
4ecef0dadf01
(svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents:
9867
diff
changeset
|
1246 |
|
9614
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
1247 |
local list = AIVehicleList(); |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
1248 |
|
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
1249 |
print(""); |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
1250 |
print("--VehicleList--"); |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
1251 |
print(" Count(): " + list.Count()); |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
1252 |
list.Valuate(AIVehicle.GetLocation); |
9614
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
1253 |
print(" Location ListDump:"); |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
1254 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
1255 |
print(" " + i + " => " + list.GetValue(i)); |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
1256 |
} |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
1257 |
list.Valuate(AIVehicle.GetEngineType); |
9614
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
1258 |
print(" EngineType ListDump:"); |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
1259 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
1260 |
print(" " + i + " => " + list.GetValue(i)); |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
1261 |
} |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
1262 |
list.Valuate(AIVehicle.GetUnitNumber); |
9614
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
1263 |
print(" UnitNumber ListDump:"); |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
1264 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
1265 |
print(" " + i + " => " + list.GetValue(i)); |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
1266 |
} |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
1267 |
list.Valuate(AIVehicle.GetAge); |
9614
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
1268 |
print(" Age ListDump:"); |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
1269 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
1270 |
print(" " + i + " => " + list.GetValue(i)); |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
1271 |
} |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
1272 |
list.Valuate(AIVehicle.GetMaxAge); |
9614
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
1273 |
print(" MaxAge ListDump:"); |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
1274 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
1275 |
print(" " + i + " => " + list.GetValue(i)); |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
1276 |
} |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
1277 |
list.Valuate(AIVehicle.GetAgeLeft); |
9614
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
1278 |
print(" AgeLeft ListDump:"); |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
1279 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
1280 |
print(" " + i + " => " + list.GetValue(i)); |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
1281 |
} |
10187
d5a6eba5af45
(svn r12718) [NoAI] -Add: added AIVehicle::GetCurrentSpeed
truebrain
parents:
10088
diff
changeset
|
1282 |
list.Valuate(AIVehicle.GetCurrentSpeed); |
d5a6eba5af45
(svn r12718) [NoAI] -Add: added AIVehicle::GetCurrentSpeed
truebrain
parents:
10088
diff
changeset
|
1283 |
print(" CurrentSpeed ListDump:"); |
d5a6eba5af45
(svn r12718) [NoAI] -Add: added AIVehicle::GetCurrentSpeed
truebrain
parents:
10088
diff
changeset
|
1284 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
d5a6eba5af45
(svn r12718) [NoAI] -Add: added AIVehicle::GetCurrentSpeed
truebrain
parents:
10088
diff
changeset
|
1285 |
print(" " + i + " => " + list.GetValue(i)); |
d5a6eba5af45
(svn r12718) [NoAI] -Add: added AIVehicle::GetCurrentSpeed
truebrain
parents:
10088
diff
changeset
|
1286 |
} |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
1287 |
list.Valuate(AIVehicle.GetRunningCost); |
9806
d65cc2bcb0de
(svn r12312) [NoAI] -Fix: AIVehicle_vRunningCost didn't exist
truebrain
parents:
9801
diff
changeset
|
1288 |
print(" RunningCost ListDump:"); |
d65cc2bcb0de
(svn r12312) [NoAI] -Fix: AIVehicle_vRunningCost didn't exist
truebrain
parents:
9801
diff
changeset
|
1289 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
d65cc2bcb0de
(svn r12312) [NoAI] -Fix: AIVehicle_vRunningCost didn't exist
truebrain
parents:
9801
diff
changeset
|
1290 |
print(" " + i + " => " + list.GetValue(i)); |
d65cc2bcb0de
(svn r12312) [NoAI] -Fix: AIVehicle_vRunningCost didn't exist
truebrain
parents:
9801
diff
changeset
|
1291 |
} |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
1292 |
list.Valuate(AIVehicle.GetProfitThisYear); |
9614
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
1293 |
print(" ProfitThisYear ListDump:"); |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
1294 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
1295 |
print(" " + i + " => " + list.GetValue(i)); |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
1296 |
} |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
1297 |
list.Valuate(AIVehicle.GetProfitLastYear); |
9614
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
1298 |
print(" ProfitLastYear ListDump:"); |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
1299 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
1300 |
print(" " + i + " => " + list.GetValue(i)); |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
1301 |
} |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9810
diff
changeset
|
1302 |
list.Valuate(AIVehicle.GetVehicleType); |
9684
623970482fb2
(svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents:
9682
diff
changeset
|
1303 |
print(" VehicleType ListDump:"); |
623970482fb2
(svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents:
9682
diff
changeset
|
1304 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
623970482fb2
(svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents:
9682
diff
changeset
|
1305 |
print(" " + i + " => " + list.GetValue(i)); |
623970482fb2
(svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents:
9682
diff
changeset
|
1306 |
} |
10668
495789401303
(svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents:
10650
diff
changeset
|
1307 |
list.Valuate(AIVehicle.GetRoadType); |
495789401303
(svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents:
10650
diff
changeset
|
1308 |
print(" RoadType ListDump:"); |
495789401303
(svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents:
10650
diff
changeset
|
1309 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
495789401303
(svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents:
10650
diff
changeset
|
1310 |
print(" " + i + " => " + list.GetValue(i)); |
495789401303
(svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents:
10650
diff
changeset
|
1311 |
} |
10193
9f73edc0c57a
(svn r12724) [NoAI] -Fix r12720: also add regression test for new functions
truebrain
parents:
10191
diff
changeset
|
1312 |
list.Valuate(AIVehicle.GetCapacity, 10); |
9f73edc0c57a
(svn r12724) [NoAI] -Fix r12720: also add regression test for new functions
truebrain
parents:
10191
diff
changeset
|
1313 |
print(" VehicleType ListDump:"); |
9f73edc0c57a
(svn r12724) [NoAI] -Fix r12720: also add regression test for new functions
truebrain
parents:
10191
diff
changeset
|
1314 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
9f73edc0c57a
(svn r12724) [NoAI] -Fix r12720: also add regression test for new functions
truebrain
parents:
10191
diff
changeset
|
1315 |
print(" " + i + " => " + list.GetValue(i)); |
9f73edc0c57a
(svn r12724) [NoAI] -Fix r12720: also add regression test for new functions
truebrain
parents:
10191
diff
changeset
|
1316 |
} |
9f73edc0c57a
(svn r12724) [NoAI] -Fix r12720: also add regression test for new functions
truebrain
parents:
10191
diff
changeset
|
1317 |
list.Valuate(AIVehicle.GetCargoLoad, 10); |
9f73edc0c57a
(svn r12724) [NoAI] -Fix r12720: also add regression test for new functions
truebrain
parents:
10191
diff
changeset
|
1318 |
print(" VehicleType ListDump:"); |
9f73edc0c57a
(svn r12724) [NoAI] -Fix r12720: also add regression test for new functions
truebrain
parents:
10191
diff
changeset
|
1319 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
9f73edc0c57a
(svn r12724) [NoAI] -Fix r12720: also add regression test for new functions
truebrain
parents:
10191
diff
changeset
|
1320 |
print(" " + i + " => " + list.GetValue(i)); |
9f73edc0c57a
(svn r12724) [NoAI] -Fix r12720: also add regression test for new functions
truebrain
parents:
10191
diff
changeset
|
1321 |
} |
9518
b32191854ad9
(svn r9432) [NoAI] -Add: added regression-test for AIVehicle()
truelight
parents:
9511
diff
changeset
|
1322 |
} |
b32191854ad9
(svn r9432) [NoAI] -Add: added regression-test for AIVehicle()
truelight
parents:
9511
diff
changeset
|
1323 |
|
10344
b7e9f5c65e30
(svn r12885) [NoAI] -Add: added AISubsidy and AIEventSubsidyNNN (Yexo)
truebrain
parents:
10291
diff
changeset
|
1324 |
function Regression::PrintSubsidy(subsidy_id) |
b7e9f5c65e30
(svn r12885) [NoAI] -Add: added AISubsidy and AIEventSubsidyNNN (Yexo)
truebrain
parents:
10291
diff
changeset
|
1325 |
{ |
b7e9f5c65e30
(svn r12885) [NoAI] -Add: added AISubsidy and AIEventSubsidyNNN (Yexo)
truebrain
parents:
10291
diff
changeset
|
1326 |
print(" --Subsidy (" + subsidy_id + ") --"); |
b7e9f5c65e30
(svn r12885) [NoAI] -Add: added AISubsidy and AIEventSubsidyNNN (Yexo)
truebrain
parents:
10291
diff
changeset
|
1327 |
print(" IsValidSubsidy(): " + AISubsidy.IsValidSubsidy(subsidy_id)); |
b7e9f5c65e30
(svn r12885) [NoAI] -Add: added AISubsidy and AIEventSubsidyNNN (Yexo)
truebrain
parents:
10291
diff
changeset
|
1328 |
print(" IsAwarded(): " + AISubsidy.IsAwarded(subsidy_id)); |
b7e9f5c65e30
(svn r12885) [NoAI] -Add: added AISubsidy and AIEventSubsidyNNN (Yexo)
truebrain
parents:
10291
diff
changeset
|
1329 |
print(" GetAwardedTo(): " + AISubsidy.GetAwardedTo(subsidy_id)); |
b7e9f5c65e30
(svn r12885) [NoAI] -Add: added AISubsidy and AIEventSubsidyNNN (Yexo)
truebrain
parents:
10291
diff
changeset
|
1330 |
print(" GetExpireDate(): " + AISubsidy.GetExpireDate(subsidy_id)); |
b7e9f5c65e30
(svn r12885) [NoAI] -Add: added AISubsidy and AIEventSubsidyNNN (Yexo)
truebrain
parents:
10291
diff
changeset
|
1331 |
print(" SourceIsTown(): " + AISubsidy.SourceIsTown(subsidy_id)); |
b7e9f5c65e30
(svn r12885) [NoAI] -Add: added AISubsidy and AIEventSubsidyNNN (Yexo)
truebrain
parents:
10291
diff
changeset
|
1332 |
print(" GetSource(): " + AISubsidy.GetSource(subsidy_id)); |
b7e9f5c65e30
(svn r12885) [NoAI] -Add: added AISubsidy and AIEventSubsidyNNN (Yexo)
truebrain
parents:
10291
diff
changeset
|
1333 |
print(" DestionationIsTown(): " + AISubsidy.DestinationIsTown(subsidy_id)); |
b7e9f5c65e30
(svn r12885) [NoAI] -Add: added AISubsidy and AIEventSubsidyNNN (Yexo)
truebrain
parents:
10291
diff
changeset
|
1334 |
print(" GetDestionation(): " + AISubsidy.GetDestination(subsidy_id)); |
b7e9f5c65e30
(svn r12885) [NoAI] -Add: added AISubsidy and AIEventSubsidyNNN (Yexo)
truebrain
parents:
10291
diff
changeset
|
1335 |
print(" GetCargoType(): " + AISubsidy.GetCargoType(subsidy_id)); |
b7e9f5c65e30
(svn r12885) [NoAI] -Add: added AISubsidy and AIEventSubsidyNNN (Yexo)
truebrain
parents:
10291
diff
changeset
|
1336 |
} |
b7e9f5c65e30
(svn r12885) [NoAI] -Add: added AISubsidy and AIEventSubsidyNNN (Yexo)
truebrain
parents:
10291
diff
changeset
|
1337 |
|
9460
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
1338 |
|
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
1339 |
function Regression::Start() |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
1340 |
{ |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
1341 |
this.TestInit(); |
9487
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
9485
diff
changeset
|
1342 |
this.Std(); |
9460
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
1343 |
this.Base(); |
9691
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
9684
diff
changeset
|
1344 |
this.List(); |
9654
b836eb5c521f
(svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
9652
diff
changeset
|
1345 |
this.Airport(); |
9792
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
1346 |
this.Bridge(); |
e1222f4674c2
(svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents:
9791
diff
changeset
|
1347 |
this.BridgeList(); |
9460
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
1348 |
this.Cargo(); |
9785
edbd185e05ed
(svn r12280) [NoAI] -Add: added AICargoList (Morloth)
truebrain
parents:
9776
diff
changeset
|
1349 |
this.CargoList(); |
9460
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
1350 |
this.Company(); |
9711
c8b427215c9d
(svn r11295) [NoAI] -Change [API CHANGE]: put Engine things in AIEngine, and rename functions as such. Most noticable: FindBestXXXVehicle -> FineBestXXXEngine
truelight
parents:
9710
diff
changeset
|
1351 |
this.Engine(); |
9714
fdbdae7ea647
(svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents:
9713
diff
changeset
|
1352 |
this.EngineList(); |
9682
d031eb183733
(svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents:
9672
diff
changeset
|
1353 |
this.Event(); |
10910
85f71706f496
(svn r13461) [NoAI] -Fix: add A* to regression, so we test it a bit (very basic test ;))
truebrain
parents:
10904
diff
changeset
|
1354 |
this.Graph(); |
9460
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
1355 |
this.Industry(); |
9649
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
1356 |
this.IndustryList(); |
9460
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
1357 |
this.Map(); |
9691
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
9684
diff
changeset
|
1358 |
this.Marine(); |
10896
6bb839ed0002
(svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents:
10889
diff
changeset
|
1359 |
this.Queues(); |
9485
df09b849ca60
(svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents:
9470
diff
changeset
|
1360 |
this.Road(); |
9511 | 1361 |
this.Sign(); |
9638
f6d169a5a45a
(svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents:
9636
diff
changeset
|
1362 |
this.Station(); |
9592
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
9589
diff
changeset
|
1363 |
this.TileList(); |
9460
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
1364 |
this.Town(); |
9589
2fbda08db406
(svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
9585
diff
changeset
|
1365 |
this.TownList(); |
9794
5d866d7cb991
(svn r12298) [NoAI] -Add: added AITunnel (Morloth)
truebrain
parents:
9793
diff
changeset
|
1366 |
this.Tunnel(); |
9518
b32191854ad9
(svn r9432) [NoAI] -Add: added regression-test for AIVehicle()
truelight
parents:
9511
diff
changeset
|
1367 |
this.Vehicle(); |
9546
fde20f518285
(svn r9477) [NoAI] -Add: added regression-test for AIOrder()
truelight
parents:
9541
diff
changeset
|
1368 |
/* Order has to be after Vehicle */ |
fde20f518285
(svn r9477) [NoAI] -Add: added regression-test for AIOrder()
truelight
parents:
9541
diff
changeset
|
1369 |
this.Order(); |
10344
b7e9f5c65e30
(svn r12885) [NoAI] -Add: added AISubsidy and AIEventSubsidyNNN (Yexo)
truebrain
parents:
10291
diff
changeset
|
1370 |
PrintSubsidy(0); |
9823
0b7f816cf46f
(svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents:
9814
diff
changeset
|
1371 |
|
0b7f816cf46f
(svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents:
9814
diff
changeset
|
1372 |
/* Sleep now, to give time for events to happen */ |
0b7f816cf46f
(svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents:
9814
diff
changeset
|
1373 |
Sleep(4000); |
0b7f816cf46f
(svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents:
9814
diff
changeset
|
1374 |
|
0b7f816cf46f
(svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents:
9814
diff
changeset
|
1375 |
while (AIEventController.IsEventWaiting()) { |
0b7f816cf46f
(svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents:
9814
diff
changeset
|
1376 |
local e = AIEventController.GetNextEvent(); |
0b7f816cf46f
(svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents:
9814
diff
changeset
|
1377 |
print(" GetNextEvent: " + (e == null ? "null" : "instance")); |
0b7f816cf46f
(svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents:
9814
diff
changeset
|
1378 |
print(" GetEventType: " + e.GetEventType()); |
0b7f816cf46f
(svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents:
9814
diff
changeset
|
1379 |
switch (e.GetEventType()) { |
10086
6497ef78f031
(svn r12610) [NoAI] -Fix: a subsidiary is a 'subcompany' and not the financial bonus for routes which is called a subsidy.
rubidium
parents:
9874
diff
changeset
|
1380 |
case AIEvent.AI_ET_SUBSIDY_OFFER: |
6497ef78f031
(svn r12610) [NoAI] -Fix: a subsidiary is a 'subcompany' and not the financial bonus for routes which is called a subsidy.
rubidium
parents:
9874
diff
changeset
|
1381 |
local c = AIEventSubsidyOffer.Convert(e); |
6497ef78f031
(svn r12610) [NoAI] -Fix: a subsidiary is a 'subcompany' and not the financial bonus for routes which is called a subsidy.
rubidium
parents:
9874
diff
changeset
|
1382 |
print(" EventName: SubsidyOffer"); |
10344
b7e9f5c65e30
(svn r12885) [NoAI] -Add: added AISubsidy and AIEventSubsidyNNN (Yexo)
truebrain
parents:
10291
diff
changeset
|
1383 |
PrintSubsidy(c.GetSubsidyID()); |
9823
0b7f816cf46f
(svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents:
9814
diff
changeset
|
1384 |
break; |
0b7f816cf46f
(svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents:
9814
diff
changeset
|
1385 |
|
10370
fa4f88090694
(svn r12911) [NoAI] -Add: added AIEventVehicle(List|WaitingInDepot|Unprofitable) (Yexo)
truebrain
parents:
10361
diff
changeset
|
1386 |
case AIEvent.AI_ET_VEHICLE_WAITING_IN_DEPOT: |
fa4f88090694
(svn r12911) [NoAI] -Add: added AIEventVehicle(List|WaitingInDepot|Unprofitable) (Yexo)
truebrain
parents:
10361
diff
changeset
|
1387 |
local c = AIEventVehicleWaitingInDepot.Convert(e); |
fa4f88090694
(svn r12911) [NoAI] -Add: added AIEventVehicle(List|WaitingInDepot|Unprofitable) (Yexo)
truebrain
parents:
10361
diff
changeset
|
1388 |
print(" EventName: VehicleWaitingInDepot"); |
fa4f88090694
(svn r12911) [NoAI] -Add: added AIEventVehicle(List|WaitingInDepot|Unprofitable) (Yexo)
truebrain
parents:
10361
diff
changeset
|
1389 |
print(" VehicleID: " + c.GetVehicleID()); |
fa4f88090694
(svn r12911) [NoAI] -Add: added AIEventVehicle(List|WaitingInDepot|Unprofitable) (Yexo)
truebrain
parents:
10361
diff
changeset
|
1390 |
break; |
fa4f88090694
(svn r12911) [NoAI] -Add: added AIEventVehicle(List|WaitingInDepot|Unprofitable) (Yexo)
truebrain
parents:
10361
diff
changeset
|
1391 |
|
9823
0b7f816cf46f
(svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents:
9814
diff
changeset
|
1392 |
default: |
0b7f816cf46f
(svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents:
9814
diff
changeset
|
1393 |
print(" Unknown Event"); |
0b7f816cf46f
(svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents:
9814
diff
changeset
|
1394 |
break; |
0b7f816cf46f
(svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents:
9814
diff
changeset
|
1395 |
} |
0b7f816cf46f
(svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents:
9814
diff
changeset
|
1396 |
} |
0b7f816cf46f
(svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents:
9814
diff
changeset
|
1397 |
print(" IsEventWaiting: false"); |
9460
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
1398 |
} |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
1399 |