There are some bugs about logging.
from negmas import Outcome, MechanismState, ResponseType
from scml import SCML2023OneShotWorld, GreedySyncAgent
from scml.oneshot import OneShotAgent
class MyAgent(OneShotAgent):
def init(self):
super().init()
self.awi.logdebug_agent("agent!")
self.awi.logdebug("world!")
def propose(self, negotiator_id: str, state: MechanismState) -> Outcome:
return tuple([1, 1, 1])
def respond(
self, negotiator_id: str, state: MechanismState, offer: Outcome
) -> ResponseType:
return ResponseType.ACCEPT_OFFER
world = SCML2023OneShotWorld(
**SCML2023OneShotWorld.generate(
agent_types=[MyAgent] * 2,
agent_processes=[0, 1],
n_steps=3,
n_processes=2,
name="test",
)
)
world.run()
2023-04-04 21:54:36,439 - DEBUG - 0/3 [0.00%]: world!
2023-04-04 21:54:36,439 - DEBUG - 0/3 [0.00%]: world!
2023-04-04 21:54:36,439 - INFO - 0/3 [0.00%]: 0 Negotiations/4 Agents
2023-04-04 21:54:36,440 - DEBUG - 0/3 [0.00%]: 01My@1 requested to buy 1 to 00My@0 q: (1, 10), u: (15, 16), t: (0, 0)
...
2023-04-04 21:54:36,437 - INFO - 0/3 [0.00%]: test: World Created
2023-04-04 21:54:36,438 - INFO - 0/3 [0.00%]: 00My@0 joined
2023-04-04 21:54:36,438 - INFO - 0/3 [0.00%]: 01My@1 joined
2023-04-04 21:54:36,438 - INFO - 0/3 [0.00%]: SELLER joined
2023-04-04 21:54:36,438 - INFO - 0/3 [0.00%]: BUYER joined
2023-04-04 21:54:36,439 - DEBUG - 0/3 [0.00%]: world!
2023-04-04 21:54:36,439 - DEBUG - 0/3 [0.00%]: world!
2023-04-04 21:54:36,439 - INFO - 0/3 [0.00%]: 0 Negotiations/4 Agents
2023-04-04 21:54:36,440 - DEBUG - 0/3 [0.00%]: 01My@1 requested to buy 1 to 00My@0 q: (1, 10), u: (15, 16), t: (0, 0)