<jupyter_start><jupyter_text>How to install JupiterJupiter is on PyPI, so you can use pip to install it:``` bash$ pip install jupiter-negotiation$ jupiter --test```Jupiter is only developed in Python3.If you want to use Jupiter, please see this notebook.  1. import jupiter<jupyter_code>from jupiter.simulator import Jupiter
from jupiter.simulator import negotiationRule<jupyter_output><empty_output><jupyter_text>2. open paths about domain file and agents file<jupyter_code>import sys
import os
import site
import importlib
from jupiter import agents<jupyter_output><empty_output><jupyter_text>3. execute test<jupyter_code>from jupiter.simulator import jupiter
%config InlineBackend.figure_format = 'retina'
jupiter.test(is_notebook=True)<jupyter_output>------------------------------
start negotiation: 1
last turn: 0.11666666666666667
agreement bid: [0, 0]
parato distance: 0.2831292
nash distance: 0.33097187
LinearAgent : 0.7644222742526002
ConsederAgent : 0.5096148495017334<jupyter_text>4. Negotiation with two players (display the process of a negotiation)<jupyter_code>jupiter = Jupiter(negotiationRule.TypeOfNegotiation.Turn, 100, 
                  '../jupiter/domain/Atlas3/triangularFight.xml',
                  '../jupiter/domain/Atlas3/triangularFight_util1.xml',  
                  '../jupiter/domain/Atlas3/triangularFight_util2.xml')  
import linearAgent
jupiter.set_agent(linearAgent, 'LinearAgent')
import concederAgent
jupiter.set_agent(concederAgent, 'ConcederAgent')

jupiter.set_notebook_flag()
%config InlineBackend.figure_format = 'retina'
jupiter.do_negotiation(is_printing=True, print_times=1)
jupiter.display.plot_initialize()
jupiter.display.plot2_notebook(jupiter.get_action_list_list()[-1],
                               jupiter.get_agreement_list()[-1])<jupyter_output>------------------------------
start negotiation: 1<jupyter_text>5. A example of repeated negotiation<jupyter_code>jupiter = Jupiter(negotiationRule.TypeOfNegotiation.Turn, 30, 
                  '../jupiter/domain/Atlas3/triangularFight.xml',
                  '../jupiter/domain/Atlas3/triangularFight_util1.xml',  
                  '../jupiter/domain/Atlas3/triangularFight_util2.xml',
                  '../jupiter/domain/Atlas3/triangularFight_util3.xml')
import linearAgent
jupiter.set_agent(linearAgent, 'LinearAgent')
import concederAgent
jupiter.set_agent(concederAgent, 'ConcederAgent')
import boulwareAgent
jupiter.set_agent(boulwareAgent, 'BoulwareAgent')

# repeat a negotiation 100 times.
for i in range(0, 100):
    jupiter.do_negotiation(is_printing=False)<jupyter_output>------------------------------
start negotiation: 1
last turn: 0.4666666666666667
agreement bid: [2, 0]
parato distance: 0.6500584
nash distance: 1.0039668
LinearAgent : 0.22763659158890676
ConsederAgent : 0.11381829579445338
BoulwareAgent : 0.34145488738336016
------------------------------
start negotiation: 2
last turn: 0.4666666666666667
agreement bid: [2, 0]
parato distance: 0.6500584
nash distance: 1.0039668
LinearAgent : 0.22763659158890676
ConsederAgent : 0.11381829579445338
BoulwareAgent : 0.34145488738336016
------------------------------
start negotiation: 3
last turn: 0.4666666666666667
agreement bid: [2, 0]
parato distance: 0.6500584
nash distance: 1.0039668
LinearAgent : 0.22763659158890676
ConsederAgent : 0.11381829579445338
BoulwareAgent : 0.34145488738336016
------------------------------
start negotiation: 4
last turn: 0.4666666666666667
agreement bid: [2, 0]
parato distance: 0.6500584
nash distance: 1.0039668
LinearAgent : 0.22763659158890676
ConsederAgent : 0.113818[...]<jupyter_text>6.1 Get the results of negotiation<jupyter_code>utility_list = jupiter.get_end_utility_list()
linear = []
boulware = []
conceder = []
parato = []
for i in utility_list:
    print(i)
    linear.append(i["LinearAgent"])
    boulware.append(i["BoulwareAgent"])
    conceder.append(i["ConsederAgent"])
    parato.append(i["parato_distance"])<jupyter_output>{'LinearAgent': 0.22763659158890676, 'ConsederAgent': 0.11381829579445338, 'BoulwareAgent': 0.34145488738336016, 'agreement_bid': [2, 0], 'parato_distance': 0.6500584}
{'LinearAgent': 0.22763659158890676, 'ConsederAgent': 0.11381829579445338, 'BoulwareAgent': 0.34145488738336016, 'agreement_bid': [2, 0], 'parato_distance': 0.6500584}
{'LinearAgent': 0.22763659158890676, 'ConsederAgent': 0.11381829579445338, 'BoulwareAgent': 0.34145488738336016, 'agreement_bid': [2, 0], 'parato_distance': 0.6500584}
{'LinearAgent': 0.22763659158890676, 'ConsederAgent': 0.11381829579445338, 'BoulwareAgent': 0.34145488738336016, 'agreement_bid': [2, 0], 'parato_distance': 0.6500584}
{'LinearAgent': 0.22763659158890676, 'ConsederAgent': 0.11381829579445338, 'BoulwareAgent': 0.34145488738336016, 'agreement_bid': [2, 0], 'parato_distance': 0.6500584}
{'LinearAgent': 0.22763659158890676, 'ConsederAgent': 0.11381829579445338, 'BoulwareAgent': 0.34145488738336016, 'agreement_bid': [2, 0], 'parato_distance': 0.6[...]<jupyter_text>6.2 Plot the results.<jupyter_code>import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt

left = np.array(range(0, len(utility_list)))
p2 = plt.plot(left, linear, marker='o', linewidth=2)
p3 = plt.plot(left, parato, marker='o', linewidth=2)
plt.title("results of repeated negotiations")
plt.xlabel("the number of repetition")
plt.ylabel("utility value or parato distance")
plt.grid(True)
plt.legend(( p2[0], p3[0]), ( "LinearAgent", "parato_distance"), loc=2)
from plotly.offline import iplot, init_notebook_mode
import plotly.plotly as py
from plotly.graph_objs import Scatter, Data


init_notebook_mode(connected=True) 

trace0 = Scatter(
    x=left,
    y=parato,
    name="parato_distance"
)

trace1 = Scatter(
    x=left,
    y=linear,
    name="LinearAgent"
)

data = Data([trace0, trace1])
# data = Data([trace0])
unique_url = iplot(data, filename = 'basic-line')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14404338247754617, 'fraction_numerical': 0.1415014404338248, 'mean_word_length': 4.7749510763209395, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 7}, 'pii_count': 0, 'substrings_counts': 5, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '294814', 'license': 'MIT', 'n_tokens_mistral': 2606, 'n_tokens_neox': 2060, 'n_words': 411, 'path': 'notebooks/quick_start.ipynb', 'repo_name': 'TomoyaFukui/Jupiter', 'size': '5901'}