![openttd signals on bridges openttd signals on bridges](https://wiki.openttd.org/uploads/en/Community/Junctionary/Flyover-loop.png)
Handle industries that produces more than one cargo.Employ statues, advertising campaigns and buy exclusive transport rights when necessary.Build railroad routes to transport secondary/tertiary cargo.Better junction placement to avoid strange results.trAIns is partially compatible with the NewGRF files NARS (North American Renewal Set) and 2CC.The town selection tries to avoid the towns that demands some cargo to grow.To do this, it considers the monthly production rate, the number of stations around the industry, the cargo type and the percentage of production transported last month. It tries to select the industries with the largest potential of money generation.During the railroad route management, trAIns can detect unprofitable routes and demolish them.
![openttd signals on bridges openttd signals on bridges](https://wiki.openttd.org/uploads/en/Manual/Adv%20terminus%204tr.png)
![openttd signals on bridges openttd signals on bridges](http://i.stack.imgur.com/Z0yQP.png)
Its cost function is simple enough to avoid the expansion of several nodes and to permit the planning of relative long railways (250 tiles of length). The railroad planner applies a carefully implemented version of A* algorithm.During the evaluation, it considers the aspects: maximum reliability, running costs, maximum speed, power, weight and price. It will change the locomotive engine when it recognizes that the new one is the best engine available. trAIns can change the rail type to employ new locomotives.The goal is to always keep at least one train waiting to be loaded in each loading station. This dynamism permits the adjustment when the production increases or decreases or when another company starts to transport the industry production. The number of trains in each railroad route is computed dynamically.Furthermore, this concept permits the concentration of production, another important strategy adopted by some players. These branches allow the creation of complex railway networks (that is, several industries can have their production transported to one destination industry sharing parts of the railroad). Some special parts (named junctions parts) can be applied to branch the railroad.This approach permits many trains to circulate on the same route and also imitates one construction style of human players. The construction of railroads employs an abstraction called double parts that enables the construction of double railways.The following list enumerates the major trAIns features. Therefore, trAIns has been created to provide a competitive and intelligent AI that can play with railroads according to this concept. Second, consequently in our opinion, there were/are few AIs that could/can use trains and generate good results according to the following metric.Ī general metric of intelligence for AIs (and the chosen one for this context) is that its actions and decisions must result in behaviors similar to those caused by human players. First, they have the most complex construction and management process as they incorporate almost all the challenges present in the construction and management of other transport types routes. There are two main reasons that explain why railroad routes have been chosen as the only transport type used. It can be downloaded and installed automatically using the game mechanism that manages on-line content. It has been written using the Squirrel language and the NoAI API. The creation of trAIns has started as a graduation project that after became a research project. The AI is called trAIns because it only constructs and manages railroad routes - one of the four transport types available in the game. TrAIns is an AI for OpenTTD (the acronym AI will be adopted to denote a set of algorithms that control an agent in the game).