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) 
True
>>> 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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file pyneg-1.0.2.tar.gz.

File metadata

  • Download URL: pyneg-1.0.2.tar.gz
  • Upload date:
  • Size: 31.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5

File hashes

Hashes for pyneg-1.0.2.tar.gz
Algorithm Hash digest
SHA256 aefe703a35cf919a5b7ec91e0ce3cb6b0854674df086f471b567d2ae57ce9c42
MD5 dd835c2cf07c8629dcaf943af2642a94
BLAKE2b-256 da6afa281c263f50ddc23457663e6489159c61175e644b694173c4e5d46c2a13

See more details on using hashes here.

File details

Details for the file pyneg-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: pyneg-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 47.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5

File hashes

Hashes for pyneg-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a85e8a995739668ab13a8673e38f2194872f4000697de96412f55b58b1acf9f7
MD5 f167164fbfc33ff14e566faf2ecc9360
BLAKE2b-256 5328e7caeb7ace3bd183ad10bbc4c57339a1663e86aabf002e82eb89cbeefafd

See more details on using hashes here.

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