Package horizons :: Package ai :: Package aiplayer :: Package behavior :: Module diplomacysettings
[hide private]
[frames] | no frames]

Source Code for Module horizons.ai.aiplayer.behavior.diplomacysettings

 1  # ################################################### 
 2  # Copyright (C) 2008-2017 The Unknown Horizons Team 
 3  # team@unknown-horizons.org 
 4  # This file is part of Unknown Horizons. 
 5  # 
 6  # Unknown Horizons is free software; you can redistribute it and/or modify 
 7  # it under the terms of the GNU General Public License as published by 
 8  # the Free Software Foundation; either version 2 of the License, or 
 9  # (at your option) any later version. 
10  # 
11  # This program is distributed in the hope that it will be useful, 
12  # but WITHOUT ANY WARRANTY; without even the implied warranty of 
13  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
14  # GNU General Public License for more details. 
15  # 
16  # You should have received a copy of the GNU General Public License 
17  # along with this program; if not, write to the 
18  # Free Software Foundation, Inc., 
19  # 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA 
20  # ################################################### 
21   
22   
23 -class DiplomacySettings:
24 upper_boundary = 5.0 25
26 - class Evil:
27 # negative weights favors opposite balance, e.g. enemy is stronger => higher relationship_score 28 weights = { 29 'power': -0.6, 30 'wealth': -0.3, 31 'terrain': -0.1, 32 } 33 34 parameters_hostile = { 35 'neutral': {'mid': 0.0, 'root': 2.0, 'peek': 0.2}, # parabola with the center at 0.0, of root at 2.0 and -2.0. Peek at 0.5 (on Y axis) 36 'ally': {'root': 7.0, }, 37 } 38 parameters_neutral = { 39 'enemy': {'root': -2.5, }, 40 'ally': {'root': 5.0, 'peek': 0.7, }, 41 } 42 parameters_allied = { 43 'neutral': {'mid': -2.0, 'root': -0.5, 'peek': 0.2, }, # parabola with the center at -2.0, of root at -0.5 (the other at -3.5). Peek at 0.2 (on Y axis) 44 'enemy': {'root': -3.5, }, # smaller chance to go straight from allied to hostile 45 }
46
47 - class Good:
48 weights = { 49 'power': 0.4, 50 'terrain': 0.4, 51 'wealth': 0.0, 52 } 53 54 parameters_hostile = { 55 'neutral': {'mid': -2.0, 'root': -0.5, 'peek': 0.2, }, 56 'ally': {'root': 1.0, }, 57 } 58 59 parameters_neutral = { 60 'ally': {'root': 4.0, }, 61 'enemy': {'root': -6.7, 'peek': 0.4}, 62 } 63 64 parameters_allied = { 65 'neutral': {'mid': -3.0, 'root': -1.5, 'peek': 0.2, }, 66 'enemy': {'root': -8.0, }, 67 }
68
69 - class Neutral:
70 weights = { 71 'wealth': -0.8, 72 'power': -0.1, 73 'terrain': -0.1, 74 } 75 76 parameters_hostile = { 77 'neutral': {'mid': 0.0, 'root': 2.0, 'peek': 0.3, }, 78 'ally': {'root': 4.0, }, 79 } 80 81 parameters_neutral = { 82 'ally': {'root': 5.0, }, 83 'enemy': {'root': -5.0, }, 84 } 85 86 parameters_allied = { 87 'neutral': {'mid': -1.0, 'root': 0.0, 'peek': 0.3, }, 88 'enemy': {'root': -7.0, }, 89 }
90