Skip to main content

A python package for simulating automated negotiations

Project description

PyNeg is a Python library for experimenting and benchmarking automated negotiatons. Using both Numpy and ProbLog as a background it can take advantage of probabalistic models and complex knowledge bases.

Some simple negotiation strategies have already been implemented and provide a template for how to implement new negotiation strategies and how to combine the various parts into an agent. This library favours composition over inheretance and thus is very modular.

for a more detailed explanation please refer to the documentation.

Minimal Working Example

>>> from pyneg.agent.agent_factory import make_linear_concession_agent 
>>> neg_space = {"first":[0, 1, 2, 3, 4], "second":[5,6,7,8,9]}  
>>> utilities_a = {"second_5":10,"second_9":-10,"first_0":-5,"first_3":5}  
>>> utilities_b = {"second_5":-5,"second_7":5,"first_0":10,"first_4":-10}  
>>> res_a = 0.1  
>>> res_b = 0.1  
>>> non_agreement_cost = -10**100   
>>> agent_a = make_linear_concession_agent("A",neg_space,utilities_a,res_a,non_agreement_cost)  
>>> agent_b = make_linear_concession_agent("B",neg_space,utilities_b,res_b,non_agreement_cost)  
>>> agent_a.negotiate(agent_b) 
>>> agent_a._transcript 
[(A=>B;OFFER;[first->3, second->5]),
(B=>A;OFFER;[first->0, second->7]),
(A=>B;OFFER;[first->1, second->5]),
(B=>A;OFFER;[first->0, second->6]),
(A=>B;OFFER;[first->2, second->5]),
(B=>A;OFFER;[first->0, second->8]),
(A=>B;OFFER;[first->4, second->5]),
(B=>A;OFFER;[first->0, second->9]),
(A=>B;OFFER;[first->3, second->6]),
(B=>A;OFFER;[first->1, second->7]),
(A=>B;OFFER;[first->0, second->5]),
(B=>A;ACCEPT;[first->0, second->5])]

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyneg-1.0.2.tar.gz (31.1 kB view hashes)

Uploaded Source

Built Distribution

pyneg-1.0.2-py3-none-any.whl (47.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page