Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MalteUniOldenburg committed Apr 19, 2024
1 parent 910b3bd commit 182d057
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -215,14 +215,14 @@ def solve(self, power_balance, initiator):
"""
# in this case, the agent did not receive any offers and the only requirement in the power balance is
# his own. Consequently, no solution can be created.
self.initial_requirement = PowerBalanceSolverStrategy.find_initial_requirement(power_balance, initiator)
try:
if len(power_balance.ledger[self.start_time]) < 2:
logger.debug(f"{self.initial_requirement.message.sender}: "
f"No offers received. Aborting solution process")
return {}, None, None
except Exception as e:
logger.info(e)
self.initial_requirement = PowerBalanceSolverStrategy.find_initial_requirement(power_balance, initiator)
# if all the available offers cannot satisfy the need for this timeslot,
# no special solving strategy is needed since all will be accepted anyway
# in this case, there are more offers than needed to satisfy the initial requirement
Expand Down

0 comments on commit 182d057

Please sign in to comment.