Converted from SVN working copy. Original SVN server no longer available. Original commit date: 2006-05-03, author: sm
74 lines
1.9 KiB
Python
Executable File
74 lines
1.9 KiB
Python
Executable File
"""
|
|
Enthaelt alle Datenstrukturen um die Sitzplatzverteilung als GA zu variieren
|
|
|
|
"""
|
|
|
|
__author__ = "Michael Stangl"
|
|
__version__ = "$Revision: $"
|
|
__date__ = "$Date: $"
|
|
__copyright__ = "Copyright (c) 2005 Michael Stangl"
|
|
__license__ = "Python"
|
|
|
|
from ga import *
|
|
from Strukturdaten import *
|
|
import ConfigParser
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
# lade Vorgaben fuer Optimierungszyklus und
|
|
config = ConfigParser.ConfigParser()
|
|
ConfigPath= os.path.join( os.getenv('PLATZ_CFG'), 'platz.cfg')
|
|
config.read( os.path.expandvars( ConfigPath ))
|
|
|
|
Zyklusconfig = os.path.normpath( config.get( 'Config', 'Zyklusdatei' ))
|
|
Zyklusconfig = os.path.expandvars( Zyklusconfig )
|
|
Zyklusart = config.get( 'Config', 'Zyklusart' )
|
|
|
|
Strafenconfig = os.path.normpath(config.get( 'Config', 'Strafendatei' ))
|
|
Strafenconfig = os.path.expandvars( Strafenconfig )
|
|
## print Strafenconfig
|
|
|
|
# lade Eingabedateien
|
|
Tischconfig = os.path.normpath(config.get( 'Config', 'Tischedatei' ))
|
|
Tischconfig = os.path.expandvars(Tischconfig)
|
|
Bestellung = os.path.normpath(config.get( 'Config', 'XMLdatei_Bestellung' ))
|
|
Bestellung = os.path.expandvars( Bestellung )
|
|
|
|
# lade Ausgabedateien
|
|
AusgabeTP= os.path.normpath(config.get( 'Config', 'AusgabeTischePersonen' ))
|
|
AusgabeTP = os.path.expandvars(AusgabeTP)
|
|
AusgabePT = os.path.normpath(config.get( 'Config', 'AusgabePersonTisch' ))
|
|
AusgabePT = os.path.expandvars(AusgabePT)
|
|
|
|
Z = Zyklus()
|
|
Z.laden( Zyklusconfig, Zyklusart )
|
|
print Z
|
|
SL = Strafliste()
|
|
SL.laden( Strafenconfig )
|
|
print SL
|
|
TE = Tische()
|
|
TE.laden( Tischconfig )
|
|
print TE
|
|
|
|
InputFile = XMLConfig()
|
|
[ PN, GN, VIPGruppe, VIPListePT ] = InputFile.laden( Bestellung )
|
|
print PN
|
|
print GN
|
|
print VIPGruppe
|
|
print VIPListePT
|
|
|
|
print "\n-- Erzeuge Farm:"
|
|
F1 = Farm( Z, Sitzplatzverteilung, Tische=TE, Gruppen=GN, Strafen=SL, VIPListe=VIPListePT, VIPs=VIPGruppe )
|
|
#print F1
|
|
S = F1.Bester()
|
|
print S
|
|
S.speichern( AusgabeTP, AusgabePT )
|
|
|
|
else:
|
|
pass
|
|
|
|
|
|
|
|
|