Negotiation is ubiquitous in our societies. With the wide-spread adoption of AI by businesses, internal operations of business units are increasingly being automated and automated negotiation between agents representing these business units is a promising direction that is starting to gain the interest of academics and industrialists. Automated negotiations promise faster more efficient agreements and more win-win deals to everyone.
The Automated Negotiation Agents Competition (ANAC) started in 2010 in conjunction with the eights International Joint Conference on Autonomous Agents and Multi-Agent Systems (AAMAS 2010) with the aim of advancing the state of the art in automated negotiation research. The competition succeeded in generating novel research in agent design and expanded to encompass several leagues focusing on different subproblems of automated negotiation. Since 2019, ANAC is run in conjunction with the International Joint Conference on Artificial Intelligence one of the largest AI conferences on the planet.
This article introduces the Supply Chain Management League (SCML), one of the five official leagues of ANAC 2020 and one of the newest additions to the competition.
The SCM World
Competitors in the SCM league are required to build an agent that controls a factory embedded in a simulated market. Besides controlling production, the agent should negotiate with other agents representing suppliers and consumers to secure supplies and sales. The score of a competitor is the median profit accumulated by all instantiations of her agent in thousands of simulations with varying configurations.
Let’s unwrap this description a bit.
The figure above shows a typical SCM world with four products organized in a chain. Each factory is capable of running one and only one of the three manufacturing processes that exist in this world (shown with the same color as the process). Each agent in the system controls one of these factories and is responsible for buying the input material, running production to generate the output product and selling output materials. All buying and selling is conducted through negotiation with two exceptions:
- The factories at the first level (green factories) have predefined contracts for buying the raw material (silicon in this case). These contracts are revealed over the simulation time and provide the supply.
- The factories at the last level (black factories) have predefined contracts for selling the final product (printed boards). These contracts are, again, revealed over the simulation time and provide the demand.
The system is event-driven where the agent is implemented as responses to events (e.g. a negotiation request is received, a contract is concluded, etc).
Why should you care?
The SCML provides a novel challenge for those interested in AI. It is not just another supervised learning task that just needs more computation power thrown at it (even though it can have that). There are several points at which you can make a contribution that results in winning:
- The overall strategy of the agent: what should the agent trade and when? What should be its goals while negotiating? Under which circumstances should it refrain from trading?
- The negotiation strategy: with whom should the agent negotiate and how?
- The production strategy: How can the agent control production so it does not over-produce while keeping all its obligations?
Given that this is the second year of the competition, there are still several low-hanging fruits. If you are building a portfolio of AI projects, this competition provides a unique challenge. If you are looking for a research topic in multi-agent systems, this competition provides several interesting problems that are of value to real businesses in the real-world.
The organizers of SCML provide several built-in agents as examples of full implementations with varying levels of success. A major decision in designing an agent for SCML is to divide up the work that needs to be done into reusable chunks that can be reasoned about as independently as possible. The decomposition used by all built-in strategies in SCML (which you reuse) is a three ways decomposition into the following components:
- Trading Strategy This is the central planner/CEO of the system. It decides what needs to be bought and sold and keeps track of the fraction of this that is already secured. It can use a Prediction Strategy for predicting supply and demand. Given that the built-in strategies are simplistic, this is one obvious target of development.
- Negotiation Manager This is the sales and supplies acquisition component. It is responsible of meeting the schedules set by the trading strategy through negotiation. Internally, it uses a Negotiation Strategy to decide how to negotiate, and a Signing Strategy to decide which of the agreements reached by its subordinate negotiators should be signed into binding contracts. Again, existing signing and negotiation strategies are simple and provide another obvious target of development.
- Production Strategy This is the manufacturing controller of the agent. It decides what should be produced when in light of the trading strategy.
Developing Your Agent
To start developing your agent, you need to install the SCML package using pip
There is a step-by-step tutorial describing how to develop an agent for SCML.
I am not going to repeat those here.
Agents can be developed using collaborative inheritance which relies on the specific way
super() works in python. Different components of the agent can hook into any of the callbacks and decide whether to allow other components to use the same callback (by calling
super()) or to prevent them from doing so. There is an excellent blog and youtube video by Raymond Hettinger about this way of code reuse.
Let’s see how can we develop an agent that uses almost all of the components of the
DecentralizingAgent built-in agent and only replaces its simplistic prediction strategy with another one (that is not much better :-) ):
We start by importing what we need.
This is the full code of our agent:
For this agent, we will only override the trade prediction strategy used by the default trading policy of the
DecentralizingAgent. We do that by overriding the only abstract method of the
We can check how our strategy is doing compared with the built-in
DecentralizingAgent by running a tournament between them. This is as easy as running the following two lines of code:
Note that if you try this it may take several minutes (or hours) because it runs thousands of simulations to ensure the statistical significance of the results reported.
In my case, the winner was
MyAgent achieving a median score of $0.34$ compared with $0.26$ for the built-in
DecentralizingAgent. The difference was not statistically significant according to the automatically run ks-test ($p=0.3$). You can just replace this simple prediction model with a more accurate one (may be using supervised learning from a corpus of simulations you run offline) and it should improve the score of your agent.
The Live Competition
One unique feature of SCML is its live competition which allows competitors to submit their agent at any time and runs tournaments between them to give each competitor some feedback about her performance against the same opponents she will face in the official competition. The scores in the live competition will not affect the final scores of the official competition so it does not hurt to submit your agent even early during its development. Submit frequently to get more timely feedback about your ideas.
Not only does this help you as a developer decide what is working and what is not working for you but it is also much more fun compared with just submitting your agent and waiting for some email a month or so later informing you of your score.
The live competition provides everything you need to build your agent with pointers to documentation, tutorials, FAQs and more.
Register today and have your agent negotiate its way to the top.
In a future post, I will go deeper into different components of the agent, their interaction and the most obvious targets for improvement.