diff --git a/flee/SimulationSettings.py b/flee/SimulationSettings.py index e17b9fbf..ba125631 100644 --- a/flee/SimulationSettings.py +++ b/flee/SimulationSettings.py @@ -292,6 +292,7 @@ def ReadFromYML(ymlfile: str): # Flee 3+ Fixed Location Routes SimulationSettings.move_rules["FixedRoutes"] = bool(fetchss(dpr,"fixed_routes",False)) + print(f"INFO: Fixed Route Generation for Locations: {SimulationSettings.move_rules['FixedRoutes']}", file=sys.stderr) # DFlee Flood Location Move rules dpf = fetchss(dpr, "flood_rules", None) diff --git a/flee/crawling.py b/flee/crawling.py index 7117594c..e3e89eff 100644 --- a/flee/crawling.py +++ b/flee/crawling.py @@ -93,8 +93,8 @@ def calculateLocCrawlLinkWeight( weights = [weight] routes = [origin_names + [link.endpoint.name]] - else: - step -= 1 + #else: + # step -= 1 #print("Endpoint:", link.endpoint.name, weights, routes, origin_names, step) @@ -151,6 +151,9 @@ def generateLocationRoutes(l, time: int, debug: bool = False): Returns: int: Index of the chosen route """ + if l.marker: + return {} + l.routes = {} if SimulationSettings.move_rules["AwarenessLevel"] == 0: @@ -167,5 +170,6 @@ def generateLocationRoutes(l, time: int, debug: bool = False): time=time, ) + print(f"Generated {len(l.routes)} routes for {l.name} at time {time}.", file=sys.stderr) return l.routes diff --git a/flee/moving.py b/flee/moving.py index 7529a6ad..b2b26634 100644 --- a/flee/moving.py +++ b/flee/moving.py @@ -491,6 +491,7 @@ def selectRoute(a, time: int, debug: bool = False, return_all_routes: bool = Fal for l in a.location.routes.keys(): weights = weights + [a.location.routes[l][0] * getEndPointScore(a, a.location.routes[l][2], time)] routes = routes + [a.location.routes[l][1]] + #print("FixedRoute Weights", weights, routes, file=sys.stderr) else: for k, e in enumerate(a.location.links): wgt, rts = calculateLinkWeight( @@ -517,7 +518,6 @@ def selectRoute(a, time: int, debug: bool = False, return_all_routes: bool = Fal weights, routes = pruneRoutes(weights, routes) - #print(weights, routes) route = chooseFromWeights(weights=weights, routes=routes) #print("route chosen:", route) diff --git a/flee/scoring.py b/flee/scoring.py index adcfd1c1..9d745f7f 100644 --- a/flee/scoring.py +++ b/flee/scoring.py @@ -125,5 +125,6 @@ def updateLocationScore(time: int, loc) -> None: # print(time, loc.name,loc.camp,loc.foreign,loc.scores) if SimulationSettings.move_rules["FixedRoutes"] is True: + #print("INFO: Generating location routes.", file=sys.stderr) crawling.generateLocationRoutes(loc, time)