X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=world.py;h=118a470b29b159d97826dc895362db8e8d673ded;hb=8adf0586ee5aeb9fbdf81b78c7ff4b484a9b82ab;hp=43126d5d63466e948317839e727a410e2b267c62;hpb=6917d3d52a4b473d31121a471ab98fa114bdb1a6;p=culture.git diff --git a/world.py b/world.py index 43126d5..118a470 100755 --- a/world.py +++ b/world.py @@ -22,7 +22,7 @@ colors = torch.tensor( [255, 0, 0], [0, 128, 0], [0, 0, 255], - [255, 255, 0], + [255, 200, 0], [192, 192, 192], ] ) @@ -41,7 +41,7 @@ def generate( f_end = torch.zeros(nb, height, width, dtype=torch.int64) n = torch.arange(f_start.size(0)) - for n in range(nb): + for n in tqdm.tqdm(range(nb), dynamic_ncols=True, desc="world generation"): nb_fish = torch.randint(max_nb_obj, (1,)).item() + 1 for c in torch.randperm(colors.size(0) - 2)[:nb_fish].sort().values: i, j = (