update the constructor
This commit is contained in:
@@ -116,10 +116,10 @@ class Worker(Thread):
|
|||||||
preceedingInbounds[runway.Runway.Name] = inbound
|
preceedingInbounds[runway.Runway.Name] = inbound
|
||||||
|
|
||||||
# configure the ACO run
|
# configure the ACO run
|
||||||
acoConfig = Configuration(earliestArrivalTime, self.sequencingConfiguration, 5 * len(relevantInbounds), 5 * len(relevantInbounds))
|
acoConfig = Configuration(constraints = self.sequencingConfiguration, inbounds = relevantInbounds,
|
||||||
if 0 != len(preceedingInbounds):
|
earliest = earliestArrivalTime, weather = self.WeatherModel,
|
||||||
acoConfig.PreceedingInbounds = preceedingInbounds
|
preceeding = None if 0 == len(preceedingInbounds) else preceedingInbounds,
|
||||||
acoConfig.Inbounds = relevantInbounds
|
ants = 5 * len(relevantInbounds), generations = 5 * len(relevantInbounds))
|
||||||
|
|
||||||
# perform the ACO run
|
# perform the ACO run
|
||||||
aco = Colony(acoConfig)
|
aco = Colony(acoConfig)
|
||||||
|
|||||||
@@ -5,16 +5,17 @@ from datetime import datetime
|
|||||||
from aman.config.AirportSequencing import AirportSequencing
|
from aman.config.AirportSequencing import AirportSequencing
|
||||||
|
|
||||||
class Configuration:
|
class Configuration:
|
||||||
def __init__(self, earliestArrivalTime : datetime, runwayInfo : AirportSequencing, antCount : int, explorationCount : int):
|
def __init__(self, **kwargs):
|
||||||
# the AMAN specific information
|
# the AMAN specific information
|
||||||
self.RunwayConstraints = runwayInfo
|
self.RunwayConstraints = kwargs.get('constraints', None)
|
||||||
self.PreceedingInbounds = None
|
self.PreceedingInbounds = kwargs.get('preceeding', None)
|
||||||
self.Inbounds = None
|
self.Inbounds = kwargs.get('inbounds', None)
|
||||||
self.EarliestArrivalTime = earliestArrivalTime
|
self.EarliestArrivalTime = kwargs.get('earliest', None)
|
||||||
|
self.WeatherModel = kwargs.get('weather', None)
|
||||||
|
|
||||||
# the ACO specific information
|
# the ACO specific information
|
||||||
self.AntCount = antCount
|
self.AntCount = kwargs.get('ants', 20)
|
||||||
self.ExplorationRuns = explorationCount
|
self.ExplorationRuns = kwargs.get('generations', 20)
|
||||||
self.PheromoneEvaporationRate = 0.9
|
self.PheromoneEvaporationRate = 0.9
|
||||||
self.PseudoRandomSelectionRate = 0.9
|
self.PseudoRandomSelectionRate = 0.9
|
||||||
self.propagationRatio = 0.9
|
self.propagationRatio = 0.9
|
||||||
|
|||||||
Reference in New Issue
Block a user