printing improvements

This commit is contained in:
Michael Pilosov 2022-11-27 01:22:23 -07:00
parent b78eadc4dc
commit 3ef0072a80
3 changed files with 7 additions and 6 deletions

3
app.py
View File

@ -112,9 +112,8 @@ if __name__ == "__main__":
print("======================")
print("SIMULATING GAMES")
# simulate 10 games
# seed(59)
players = play_roulette(players, games=100000)
players = play_roulette(players, games=1000)
for p in sorted(players):
print(p, "\n")

View File

@ -280,10 +280,12 @@ class Player:
def __repr__(self) -> str:
_nl = "\n\t" # custom newline character
return (
f"Player(id={self.id}, budget={self.budget}, wallet={self.wallet}, "
f"Player(id={self.id}, "
+ f"budget={round(self.budget, 2)}, "
+ f"wallet={round(self.wallet, 2)}, "
+ f"num_placements={len(self.strategy.placements)}, "
+ f"strategy_budget={self.strategy.budget}, "
+ f"strategy_cost={self.strategy.value}"
+ f"strategy_budget={round(self.strategy.budget, 2)}, "
+ f"strategy_cost={round(self.strategy.value, 2)}"
+ f"\nstrategy:{_nl}{_nl.join(map(str, sorted(self.strategy.placements)))}"
+ "\n)"
)

View File

@ -10,7 +10,7 @@ with open(BASEDIR.joinpath("README.md"), "r") as fp:
setup(
name="pyroulette",
version="0.0.3",
version="0.0.4",
description="A package for exploring roulette strategies.",
long_description=LONG_DESCRIPTION,
long_description_content_type="text/markdown",