Define the WormPlanner class which handles planning.  
 More...
Public Member Functions | 
| 
constructor  | WormPlanner (rail_manager) | 
| function  | GetSubsidizedRoute (planned_route) | 
|   | Choose a subsidy if there is one available that suits us.  
  | 
| function  | GetRoute (planned_route) | 
|   | Find a cargo, a source and a destination to build a new service.  
  | 
| function  | PlanRailRoute () | 
|   | Plan a rail route.  
  | 
Static Public Member Functions | 
| static function  | GetMailCargo () | 
|   | Gets the CargoID associated with mail.  
  | 
| static function  | GetLastMonthTransportedPercentage (ind, cargo) | 
|   | Get the percentage of transported cargo from a given industry.  
  | 
Public Attributes | 
| 
  | route = null | 
|   | Details about the route we planned. 
  | 
Static Public Attributes | 
| 
static  | MIN_RAIL_ROUTE_LENGTH = 40 | 
| 
static  | MAX_RAIL_ROUTE_LENGTH = 200 | 
| 
static  | MIN_POPULATION_FOR_GOODS = 1500 | 
| 
static  | MIN_POPULATION_FOR_FOOD = 100 | 
| 
static  | MIN_TOWN_EFFECT_PRODUCTION = 40 | 
| 
static  | MAX_TRANSPORTED = 60 | 
Detailed Description
Define the WormPlanner class which handles planning. 
Member Function Documentation
  
  
      
        
          | function WormPlanner::GetLastMonthTransportedPercentage  | 
          ( | 
          ind  | 
          ,  | 
         
        
           | 
           | 
          cargo  | 
            | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
static   | 
  
 
Get the percentage of transported cargo from a given industry. 
- Parameters
 - 
  
    | ind | The IndustryID of the industry.  | 
    | cargo | The cargo to be checked.  | 
  
   
- Returns
 - The percentage transported, ranging from 0 to 100. 
 
 
 
  
  
      
        
          | function WormPlanner::GetMailCargo  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
static   | 
  
 
Gets the CargoID associated with mail. 
- Note
 - Taken from SimpleAI. 
 
- Returns
 - The CargoID of mail. 
 
 
 
      
        
          | function WormPlanner::GetRoute  | 
          ( | 
          planned_route  | 
           | ) | 
           | 
        
      
 
Find a cargo, a source and a destination to build a new service. 
- Parameters
 - 
  
    | planned_route | A WormRoute class that will receive details about the planned route.  | 
  
   
- Returns
 - True if a potential connection was found. 
 
- Todo:
 - !! 
 
 
 
      
        
          | function WormPlanner::GetSubsidizedRoute  | 
          ( | 
          planned_route  | 
           | ) | 
           | 
        
      
 
Choose a subsidy if there is one available that suits us. 
- Parameters
 - 
  
    | planned_route | A WormRoute class that will receive details about the planned route.  | 
  
   
- Returns
 - True if a subsidy was chosen. 
 
- Precondition
 - planned_route should be a valid WormRoute object. 
 
- Todo:
 - Check if this gets sorted furthest or nearest expire date first. I think the highest value (thus furthest expire date) comes fist 
 
- Todo:
 - Instead of GetSetting we should define a value for ourselves... 
 
- Todo:
 - define a var/const instead of the fixed value we now use... 
 
 
 
      
        
          | function WormPlanner::PlanRailRoute  | 
          ( | 
           | ) | 
           | 
        
      
 
Plan a rail route. 
- Returns
 - True if we managed to find a route. 
 
- Todo:
 - replace number by a definied constant 
 
 
 
The documentation for this class was generated from the following file: