<jupyter_start><jupyter_text><jupyter_code>!git clone https://github.com/GuysBarash/Bargaining.git
from Bargaining.src.BargainGame import BargainGame
import sys
import pandas as pd
IN_COLAB = 'google.colab' in sys.modules
coalitions_value = dict()
coalitions_value['1_5'] = 1000
coalitions_value['1_2'] = 1000
coalitions_value['2_3'] = 1000
coalitions_value['3_4'] = 1000
coalitions_value['4_5'] = 1000
bargain_step = 50
game = BargainGame(bargain_step=bargain_step)
game.add_coalitions_from_dict(coalitions_value)
print(f"Players in game: {game.players_count}")
game.compile()
print(f"Roots detected: {len(game.roots)}")
cycles, end_points = game.get_nontransient_points()
print(f"Cycles: {len(cycles)}")
print(f"DeadEnds: {len(end_points)}")
possible_endings = len(cycles) + len(end_points)
print(f"Possible endings: {possible_endings}")
# Plot entire barganing process
game.plot_bargaining_graph(colab_mode=IN_COLAB)
# Print components
components = game.components
for idx, comp in enumerate(components):
    print(f'[{idx + 1}/{len(components)}]\t')
    for c in components[0]:
        print(c)
# Plot negotiation final form
game.plot_bargaining_graph_non_transient(colab_mode=IN_COLAB)

from google.colab import data_table
histdf = game.random_walk_graph(normalize=False)
data_table.DataTable(histdf, include_index=True)
from google.colab import data_table
histdf = game.random_walk_graph(normalize=True)
data_table.DataTable(histdf.round(4), include_index=True)
data_table.DataTable(pd.DataFrame(game.ssdf))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12119248217757615, 'fraction_numerical': 0.02268308489954634, 'mean_word_length': 8.414634146341463, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '630198', 'license': 'Apache-2.0', 'n_tokens_mistral': 596, 'n_tokens_neox': 555, 'n_words': 98, 'path': 'BarganingGame_class_example.ipynb', 'repo_name': 'GuysBarash/Bargaining', 'size': '1543'}