Skip to main content

A bridge that allows you to run GeniusWeb agents in negmas SAOMechanism(s).

Project description

negmas-geniusweb-bridge

A bridge that allows you to run GeniusWeb negotiation agents within NegMAS mechanisms.

Official GeniusWeb Resources

This project builds upon the official GeniusWeb framework. For the original implementations:

The official repositories contain:

  • Complete GeniusWeb framework implementation (Java and Python)
  • Competition agents from ANAC 2020-2023
  • Documentation and examples

AI-Assisted Development Disclaimer

Important Notice: Parts of this project were developed with AI assistance:

  • GeniusWeb-to-NegMAS Wrapper (wrapper.py): The bridge wrapper that enables GeniusWeb agents to run in NegMAS mechanisms was developed in part using AI assistance.
  • Java-to-Python Translations: The negotiation agents in the anac2020/ and anac2021/ directories were translated from their original Java implementations to Python using AI. These translations aim to preserve the original algorithms and strategies but may contain differences from the original implementations.

The original Python agents (in basic/, anl2022/, anl2023/, cse3210/) were written directly in Python by their original authors and are not AI-translated.

Users should be aware that AI-translated code may require additional validation for research or production use.

Installation

uv sync

For local development with a local negmas installation:

uv sync && uv pip install -e ../negmas

Usage

Basic Example

Run a negotiation between a GeniusWeb agent and a NegMAS agent:

from negmas import SAOMechanism, make_issue
from negmas.preferences import LinearAdditiveUtilityFunction
from negmas.sao import AspirationNegotiator

from negmas_geniusweb_bridge import BoulwareAgent

# Define the negotiation issues
issues = [make_issue(5, "price"), make_issue(3, "quality")]

# Create utility functions for each agent
ufun_a = LinearAdditiveUtilityFunction.random(issues=issues, normalized=True)
ufun_b = LinearAdditiveUtilityFunction.random(issues=issues, normalized=True)

# Create the negotiation mechanism
mechanism = SAOMechanism(issues=issues, n_steps=50)

# Create a GeniusWeb agent (Boulware strategy)
gw_agent = BoulwareAgent(ufun=ufun_a, name="geniusweb_boulware")

# Create a NegMAS agent (Aspiration strategy)
negmas_agent = AspirationNegotiator(ufun=ufun_b, name="aspiration")

# Add agents to the mechanism
mechanism.add(gw_agent)
mechanism.add(negmas_agent)

# Run the negotiation
mechanism.run()

# Check results
state = mechanism.state
print(f"Agreement: {state.agreement}")
print(f"Steps: {state.step}")

GeniusWeb vs GeniusWeb

Run a negotiation between two GeniusWeb agents:

from negmas import SAOMechanism, make_issue
from negmas.preferences import LinearAdditiveUtilityFunction

from negmas_geniusweb_bridge import BoulwareAgent, ConcederAgent

issues = [make_issue(10, "price"), make_issue(5, "quality"), make_issue(3, "delivery")]

ufun_a = LinearAdditiveUtilityFunction.random(issues=issues, normalized=True)
ufun_b = LinearAdditiveUtilityFunction.random(issues=issues, normalized=True)

mechanism = SAOMechanism(issues=issues, n_steps=100)

# Boulware agent (reluctant to concede)
agent_a = BoulwareAgent(ufun=ufun_a, name="boulware")

# Conceder agent (willing to concede quickly)
agent_b = ConcederAgent(ufun=ufun_b, name="conceder")

mechanism.add(agent_a)
mechanism.add(agent_b)
mechanism.run()

print(f"Agreement: {mechanism.state.agreement}")

Using the Factory Function

Create reusable negotiator classes:

from negmas_geniusweb_bridge.wrapper import make_geniusweb_negotiator
from negmas_geniusweb_bridge.basic.boulware_agent.boulware_agent import BoulwareAgent

# Create a reusable negotiator class
BoulwareNegotiator = make_geniusweb_negotiator(BoulwareAgent)

# Use it like any other NegMAS negotiator
negotiator = BoulwareNegotiator(ufun=my_ufun, name="boulware1")

Available Agents

The bridge includes 82+ agents from several GeniusWeb competitions. Each module exports:

  • AGENTS: Dictionary of raw GeniusWeb party classes
  • WRAPPED_AGENTS: Dictionary of NegMAS-wrapped negotiator classes (GW-prefixed)
  • AGENT_NOTES: Known issues/notes about specific agents

Agent Summary

Module Count Type Description
basic 7 Python Native Reference implementations (Boulware, Conceder, Linear, etc.)
anac2020 13 AI-Translated ANAC 2020 competition agents (from Java)
anac2021 6 AI-Translated ANAC 2021 competition agents (from Java)
anl2022 18 Python Native Automated Negotiation League 2022
anl2023 14 Python Native Automated Negotiation League 2023
cse3210 25 Python Native TU Delft CSE3210 course agents
Total 82

Basic Agents (7)

Reference implementations of classic negotiation strategies.

Agent Description Notes
BoulwareAgent Time-dependent concession (hardliner early, concedes late)
ConcederAgent Time-dependent concession (concedes early)
LinearAgent Linear concession over time
HardlinerAgent Never concedes Only useful for testing
RandomAgent Random bid selection
StupidAgent Simple random behavior Test agent
TimeDependentAgent Base class for time-dependent strategies Configurable via e parameter

ANAC 2020 Agents (13) - AI-Translated from Java

Agents from the Automated Negotiating Agents Competition 2020. These were translated from Java using AI assistance.

Agent Protocol Description
AgentKT SHAOP/SAOP COBYLA optimization with game-theoretic thresholds
AgentP1DAMO SHAOP Hill climbing with importance maps
AgentXX SHAOP/SAOP Importance maps with Nash point estimation
AhBuNeAgent SHAOP Similarity-based bidding with elicitation
Anaconda SHAOP Dynamic lower bounds with elicitation
Angel SHAOP/SAOP Heuristic opponent modeling with elicitation
AzarAgent SHAOP/SAOP GravityEs user model with frequency modeling
BlingBling SHAOP/SAOP RankNet neural network for preference learning
DUOAgent SHAOP/SAOP Linear regression for bid prediction
ForArisa SAOP Genetic algorithm for utility estimation
HammingAgent SAOP Hamming distance for opponent modeling
NiceAgent SHAOP/SAOP Elicitation with mirroring strategy
ShineAgent SAOP Adaptive agent with dynamic strategy

ANAC 2021 Agents (6) - AI-Translated from Java

Agents from the Automated Negotiating Agents Competition 2021. These were translated from Java using AI assistance.

Agent Protocol Description
AgentFO2021 SAOP Learning-based agent with time-dependent concession
AlphaBIU SAOP Frequency-based opponent modeling with two-phase strategy
GamblerAgent SAOP UCB Multi-Armed Bandit selecting among sub-agents
MatrixAlienAgent SAOP Adaptive boulware-style with multi-factor bid scoring
TheDiceHaggler2021 SAOP Multi-phase strategy with Pareto estimation and TOPSIS
TripleAgent SAOP Frequency model and utility space analysis

ANL 2022 Agents (18) - Python Native

Agents from the Automated Negotiation League 2022. Written in Python by their original authors.

Agent Notes
Agent007
Agent4410
AgentFish
AgentFO2
BIUAgent May timeout >60 secs on some domains
ChargingBoul
CompromisingAgent May cause "Action cannot be None" errors
DreamTeam109Agent
GEAAgent Slow execution (~1.5sec per turn)
LearningAgent May cause "Action cannot be None" errors
LuckyAgent2022
MiCROAgent
PinarAgent Requires lightgbm package (optional)
ProcrastinAgent May have issues with first offer accepted
RGAgent
SmartAgent
SuperAgent
ThirdAgent
Tjaronchery10Agent

ANL 2023 Agents (14) - Python Native

Agents from the Automated Negotiation League 2023. Written in Python by their original authors.

Agent Notes
AgentFO3
AmbitiousAgent
AntAllianceAgent
AntHeartAgent
ColmanAnacondotAgent2
ExploitAgent
GotAgent
HybridAgent2023
KBTimeDiffAgent
MiCRO2023
MSCAgent Requires gym, torch, stable-baselines3 (optional)
PopularAgent
SmartAgent
SpaghettiAgent
TripleEAgent

CSE3210 Agents (25) - Python Native

Agents from the TU Delft CSE3210 Negotiation course. Written in Python by students.

Agent Notes
Agent2 - Agent68 25 agents total
Agent22 May throw scipy divide by zero errors
Agent68 May have issues handling opening bid

Accessing Agents Programmatically

# Import all agents from a module
from negmas_geniusweb_bridge.anac2020 import AGENTS, WRAPPED_AGENTS, AGENT_METADATA
from negmas_geniusweb_bridge.anac2021 import AGENTS, WRAPPED_AGENTS, AGENT_NOTES
from negmas_geniusweb_bridge.anl2022 import AGENTS, WRAPPED_AGENTS, AGENT_NOTES
from negmas_geniusweb_bridge.anl2023 import AGENTS, WRAPPED_AGENTS
from negmas_geniusweb_bridge.cse3210 import AGENTS, WRAPPED_AGENTS
from negmas_geniusweb_bridge.basic import AGENTS, WRAPPED_AGENTS

# Import all wrapped agents at once
from negmas_geniusweb_bridge import ALL_AGENTS

# List all available agents
print(list(ALL_AGENTS.keys()))

# Use a wrapped agent directly
from negmas_geniusweb_bridge import HammingAgent, BoulwareAgent
agent = HammingAgent(name="my_agent")

Testing

# Run all tests
python -m pytest

# Run a specific test
python -m pytest tests/test_negmas_wrapper.py::TestNegotiationRuns::test_geniusweb_vs_geniusweb -v

License

This software is licensed for academic, research, and non-commercial use only.

Commercial use requires a separate license. Contact the author for commercial licensing inquiries.

See LICENSE for full terms.

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

negmas_geniusweb_bridge-0.1.2.tar.gz (6.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

negmas_geniusweb_bridge-0.1.2-py3-none-any.whl (7.0 MB view details)

Uploaded Python 3

File details

Details for the file negmas_geniusweb_bridge-0.1.2.tar.gz.

File metadata

  • Download URL: negmas_geniusweb_bridge-0.1.2.tar.gz
  • Upload date:
  • Size: 6.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for negmas_geniusweb_bridge-0.1.2.tar.gz
Algorithm Hash digest
SHA256 120a29991086f0bb54c5580e4e8fc68a94c2d6464bacb89ee31fe2cb967812aa
MD5 e22afd5e0cb5bc52de1096c40a4aa7d6
BLAKE2b-256 48abb83f83b9fd17b60b21cb40af3457234831cbae218347150e9a8f774b8dfd

See more details on using hashes here.

Provenance

The following attestation bundles were made for negmas_geniusweb_bridge-0.1.2.tar.gz:

Publisher: publish.yml on autoneg/negmas-geniusweb-bridge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file negmas_geniusweb_bridge-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for negmas_geniusweb_bridge-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2c260a652ac22814dc66994a1a46f29e91be843079d65f3735337cf9992f56b7
MD5 40393dcb6f3e49ee11047bc78b7703f2
BLAKE2b-256 6ec12f9b348ff0d2ed845f0470a31c88a9679dfbdbfb7234eb95622cfb70bca7

See more details on using hashes here.

Provenance

The following attestation bundles were made for negmas_geniusweb_bridge-0.1.2-py3-none-any.whl:

Publisher: publish.yml on autoneg/negmas-geniusweb-bridge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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