File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
examples/hotelling_law/hotelling_law Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -175,11 +175,15 @@ def determine_preferred_store(self):
175175 for store in stores :
176176 # Calculate score based on consumer preference
177177 if consumer_preference == "proximity" :
178- score = self .euclidean_distance (self .cell .coordinate , store .cell .coordinate )
178+ score = self .euclidean_distance (
179+ self .cell .coordinate , store .cell .coordinate
180+ )
179181 elif consumer_preference == "price" :
180182 score = store .price
181183 else : # Default case includes both proximity and price
182- score = store .price + self .euclidean_distance (self .cell .coordinate , store .cell .coordinate )
184+ score = store .price + self .euclidean_distance (
185+ self .cell .coordinate , store .cell .coordinate
186+ )
183187
184188 # Update the list of best stores if a new minimum score is found
185189 if score < min_score :
Original file line number Diff line number Diff line change @@ -190,7 +190,7 @@ def _initialize_agents(self):
190190 # Randomly place agents on the grid for a grid environment.
191191 x = self .random .randrange (self .grid .dimensions [0 ])
192192 y = self .random .randrange (self .grid .dimensions [1 ])
193- agent .cell = self .grid [(x ,y )]
193+ agent .cell = self .grid [(x , y )]
194194
195195 # Place consumer agents
196196 for _ in range (self .num_consumers ):
@@ -200,7 +200,7 @@ def _initialize_agents(self):
200200 # Place consumer randomly on the grid
201201 x = self .random .randrange (self .grid .dimensions [0 ])
202202 y = self .random .randrange (self .grid .dimensions [1 ])
203- consumer .cell = self .grid [(x ,y )]
203+ consumer .cell = self .grid [(x , y )]
204204
205205 # Method to advance the simulation by one step.
206206 def step (self ):
You can’t perform that action at this time.
0 commit comments