import json import logging from pathlib import Path import sys import time import traceback from typing import List, Optional from pyson.ObjectMapper import ObjectMapper from tudelft.utilities.listener.Listener import Listener from tudelft_utilities_logging.Reporter import Reporter from geniusweb.events.ProtocolEvent import ProtocolEvent from geniusweb.protocol.CurrentNegoState import CurrentNegoState from geniusweb.protocol.NegoProtocol import NegoProtocol from geniusweb.protocol.NegoSettings import NegoSettings from geniusweb.protocol.NegoState import NegoState from geniusweb.simplerunner.ClassPathConnectionFactory import ClassPathConnectionFactory from geniusweb.simplerunner.Runner import Runner from geniusweb.simplerunner.gui.GUI import GUI class StdOutReporter (Reporter): def log(self, level:int , msg:str, exc:Optional[BaseException]=None): if level >= logging.WARNING: print(logging.getLevelName(level) + ":" + msg, file=sys.stderr) else: print(logging.getLevelName(level) + ":" + msg) class NegoRunner: ''' A simple tool to run a negotiation stand-alone, without starting the servers. All referred files and classes need to be stored locally (or be in the dependency list if you use maven).
IMPORTANT SimpleRunner has a number of restrictions, compared to a run using a runserver and partyserver