From 322023b66f9f9e08f5e3109f780cb4572e6230a7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 14:12:50 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- examples/hotelling_law/hotelling_law/agents.py | 8 ++++++-- examples/hotelling_law/hotelling_law/model.py | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/examples/hotelling_law/hotelling_law/agents.py b/examples/hotelling_law/hotelling_law/agents.py index 9b689e31..48ebcd6a 100644 --- a/examples/hotelling_law/hotelling_law/agents.py +++ b/examples/hotelling_law/hotelling_law/agents.py @@ -175,11 +175,15 @@ def determine_preferred_store(self): for store in stores: # Calculate score based on consumer preference if consumer_preference == "proximity": - score = self.euclidean_distance(self.cell.coordinate, store.cell.coordinate) + score = self.euclidean_distance( + self.cell.coordinate, store.cell.coordinate + ) elif consumer_preference == "price": score = store.price else: # Default case includes both proximity and price - score = store.price + self.euclidean_distance(self.cell.coordinate, store.cell.coordinate) + score = store.price + self.euclidean_distance( + self.cell.coordinate, store.cell.coordinate + ) # Update the list of best stores if a new minimum score is found if score < min_score: diff --git a/examples/hotelling_law/hotelling_law/model.py b/examples/hotelling_law/hotelling_law/model.py index 4fda9c52..cf8af7b2 100644 --- a/examples/hotelling_law/hotelling_law/model.py +++ b/examples/hotelling_law/hotelling_law/model.py @@ -189,7 +189,7 @@ def _initialize_agents(self): # Randomly place agents on the grid for a grid environment. x = self.random.randrange(self.grid.dimensions[0]) y = self.random.randrange(self.grid.dimensions[1]) - agent.cell = self.grid[(x,y)] + agent.cell = self.grid[(x, y)] # Place consumer agents for _ in range(self.num_consumers): @@ -199,7 +199,7 @@ def _initialize_agents(self): # Place consumer randomly on the grid x = self.random.randrange(self.grid.dimensions[0]) y = self.random.randrange(self.grid.dimensions[1]) - consumer.cell = self.grid[(x,y)] + consumer.cell = self.grid[(x, y)] # Method to advance the simulation by one step. def step(self):