Barotrauma

Barotrauma

Not enough ratings
Accurate Fuel Rod Counter + Average Fuel %
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
73.161 KB
19 Dec, 2024 @ 12:55am
1 Change Note ( view )

Subscribe to download
Accurate Fuel Rod Counter + Average Fuel %

Description
Uses regex capturing on all the possible sums of permutations for fuel rod heat potential combinations per fuel rod count. It works around collisions by keeping track of the previous heat & rod amount concatenated (rod_count,heat) via 0.10 delay to MEM with LOCK when it matches a collision transition state. The regex capture on a collided heat value will specifically check for previous (rod_count,heat) values on all possible transitions to distinguish it etc 150,150 (2) -> 450 <- 100,100,100 (3) for affected collisions to overwrite (ordered after) with the correct value. It is further optimised by using regex capture groups to output one number from the separator ->1234, instead of requiring 4-5 regex components for each number (0-4).

Concatenation Separator:

{prev_rod_count},{prev_heat}->1234,{heat}
,
->1234,

Regex Expressions:

(?<n>1)234,(80|100|150)|1(?<n>2)34,(160|180|230|200|250)|12(?<n>3)4,(240|260|310|560|280|330|580|630|880|300|350|650|900|950|1200)|123(?<n>4),(320|340|390|640|360|410|660|460|710|960|380|430|680|480|730|980|530|780|1030|1280|400|450|700|500|750|1000|550|800|1050|1300|600|850|1100|1350|1600)|(0,(0)|2,(480|500|550|800))->(?<n>1)234,400|(2,(300|250)|4,(480|500|550|800))->12(?<n>3)4,400|(1,(400)|3,(880|900|950|1200))->1(?<n>2)34,800|(1,(400|150)|3,(630|650|700|950))->1(?<n>2)34,550|(1,(150)|3,(380|400|450|700))->1(?<n>2)34,300|(2,(550|300)|4,(780|800|850|1100))->12(?<n>3)4,700|(2,(300)|4,(530|550|600|850))->12(?<n>3)4,450|(2,(500|200)|4,(680|700|750|1000))->12(?<n>3)4,600|(1,(400|80)|3,(560|580|630|880))->1(?<n>2)34,480|(1,(400|100)|3,(580|600|650|900))->1(?<n>2)34,500|(2,(300|230)|4,(460|480|530|780))->12(?<n>3)4,380 (0,(0)|2,(480|500|550|800))->(?<n>1)234,400|(2,(300|250)|4,(480|500|550|800))->12(?<n>3)4,400|(1,(400)|3,(880|900|950|1200))->1(?<n>2)34,800|(1,(400|150)|3,(630|650|700|950))->1(?<n>2)34,550|(1,(150)|3,(380|400|450|700))->1(?<n>2)34,300|(2,(550|300)|4,(780|800|850|1100))->12(?<n>3)4,700|(2,(300)|4,(530|550|600|850))->12(?<n>3)4,450|(2,(500|200)|4,(680|700|750|1000))->12(?<n>3)4,600|(1,(400|80)|3,(560|580|630|880))->1(?<n>2)34,480|(1,(400|100)|3,(580|600|650|900))->1(?<n>2)34,500|(2,(300|230)|4,(460|480|530|780))->12(?<n>3)4,380

Combined Fuel Rod Heat Potential:

  • (1): 80, 100, 150, 400
  • (2): 160, 180, 230, 480, 200, 250, 500, 300, 550, 800
  • (3): 240, 260, 310, 560, 280, 330, 580, 380, 630, 880, 300, 350, 600, 400, 650, 900, 450, 700, 950, 1200
  • (4): 320, 340, 390, 640, 360, 410, 660, 460, 710, 960, 380, 430, 680, 480, 730, 980, 530, 780, 1030, 1280, 400, 450, 700, 500, 750, 1000, 550, 800, 1050, 1300, 600, 850, 1100, 1350, 1600

Collisions:

  • 400 [1, 3, 4]
  • 800 [2, 4]
  • 550 [2, 4]
  • 300 [2, 3]
  • 700 [3, 4]
  • 450 [3, 4]
  • 600 [3, 4]
  • 480 [2, 4]
  • 500 [2, 4]
  • 380 [3, 4]

Combinations:

(1):
[80] = 80
[100] = 100
[150] = 150
[400] = 400

(2):
[80, 80] = 160
[80, 100] = 180
[80, 150] = 230
[80, 400] = 480
[100, 100] = 200
[100, 150] = 250
[100, 400] = 500
[150, 150] = 300
[150, 400] = 550
[400, 400] = 800

(3):
[80, 80, 80] = 240
[80, 80, 100] = 260
[80, 80, 150] = 310
[80, 80, 400] = 560
[80, 100, 100] = 280
[80, 100, 150] = 330
[80, 100, 400] = 580
[80, 150, 150] = 380
[80, 150, 400] = 630
[80, 400, 400] = 880
[100, 100, 100] = 300
[100, 100, 150] = 350
[100, 100, 400] = 600
[100, 150, 150] = 400
[100, 150, 400] = 650
[100, 400, 400] = 900
[150, 150, 150] = 450
[150, 150, 400] = 700
[150, 400, 400] = 950
[400, 400, 400] = 1200

(4):
[80, 80, 80, 80] = 320
[80, 80, 80, 100] = 340
[80, 80, 80, 150] = 390
[80, 80, 80, 400] = 640
[80, 80, 100, 100] = 360
[80, 80, 100, 150] = 410
[80, 80, 100, 400] = 660
[80, 80, 150, 150] = 460
[80, 80, 150, 400] = 710
[80, 80, 400, 400] = 960
[80, 100, 100, 100] = 380
[80, 100, 100, 150] = 430
[80, 100, 100, 400] = 680
[80, 100, 150, 150] = 480
[80, 100, 150, 400] = 730
[80, 100, 400, 400] = 980
[80, 150, 150, 150] = 530
[80, 150, 150, 400] = 780
[80, 150, 400, 400] = 1030
[80, 400, 400, 400] = 1280
[100, 100, 100, 100] = 400
[100, 100, 100, 150] = 450
[100, 100, 100, 400] = 700
[100, 100, 150, 150] = 500
[100, 100, 150, 400] = 750
[100, 100, 400, 400] = 1000
[100, 150, 150, 150] = 550
[100, 150, 150, 400] = 800
[100, 150, 400, 400] = 1050
[100, 400, 400, 400] = 1300
[150, 150, 150, 150] = 600
[150, 150, 150, 400] = 850
[150, 150, 400, 400] = 1100
[150, 400, 400, 400] = 1350
[400, 400, 400, 400] = 1600

Expanded Regex:

(?<n>1)234,(80|100|150) 1(?<n>2)34,(160|180|230|200|250) 12(?<n>3)4,(240|260|310|560|280|330|580|630|880|300|350|650|900|950|1200) 123(?<n>4),(320|340|390|640|360|410|660|460|710|960|380|430|680|480|730|980|530|780|1030|1280|400|450|700|500|750|1000|550|800|1050|1300|600|850|1100|1350|1600) (0,(0)|2,(480|500|550|800))->(?<n>1)234,400 (2,(300|250)|4,(480|500|550|800))->12(?<n>3)4,400 (1,(400)|3,(880|900|950|1200))->1(?<n>2)34,800 (1,(400|150)|3,(630|650|700|950))->1(?<n>2)34,550 (1,(150)|3,(380|400|450|700))->1(?<n>2)34,300 (2,(550|300)|4,(780|800|850|1100))->12(?<n>3)4,700 (2,(300)|4,(530|550|600|850))->12(?<n>3)4,450 (2,(500|200)|4,(680|700|750|1000))->12(?<n>3)4,600 (1,(400|80)|3,(560|580|630|880))->1(?<n>2)34,480 (1,(400|100)|3,(580|600|650|900))->1(?<n>2)34,500 (2,(300|230)|4,(460|480|530|780))->12(?<n>3)4,380

Python file to generate regex expressions for modded rods:

rod_heats = [80, 100, 150, 400] # Add modded values to rod_heats list for it to work with any custom rods import itertools; heats_combo = {0: [[0]], **{n: [list(combo) for combo in itertools.combinations_with_replacement(rod_heats, n)] for n in range(1, 5)}} heats_combined = { rod: [sum(heat) for heat in heats] for rod, heats in heats_combo.items() } collisions = { heat: [rod for rod, h in heats_combined.items() if heat in h] for heat in {h for h in heats_combined.values() for h in h} if sum(1 for h in heats_combined.values() if heat in h) > 1 } regex_mem_lock, heats = [], "\n".join(f"({rod}): [{', '.join(map(lambda h: f'**{h}**' if h in collisions else str(h), heat))}]" for rod, heat in heats_combined.items() if rod != 0) prev_heat = lambda op, rod: "|".join(map(str, filter(lambda x: x in heats_combined[rod], (heat + (h if op == '+' else -h) for h in rod_heats)))) for heat, rods in collisions.items(): regex_mem_lock.extend([f"({rod-1},({prev_heat('-', rod-1)})|{rod+1},({prev_heat('+', rod+1)}))->{"1234".replace(str(rod), f"(?<n>{rod})")},{heat}" for rod in rods[:-1]]) [heats_combined[rod].remove(heat) for heat, rods in collisions.items() for rod in rods [:-1] if heat in heats_combined[rod]] regex = { rod: f"{"1234".replace(str(rod), f"(?<n>{rod})")},({'|'.join(map(str, heat))})" for rod, heat in heats_combined.items() if rod != 0 } print("Regex Expressions:\n" + "|".join(f"{expression}" for rod, expression in regex.items()) + "|" + "|".join(regex_mem_lock) + "\n" + "|".join(regex_mem_lock)) print("\nConcatenation Separator:\n,\n->1234,") print("\nCombined Fuel Rod Heat Potential:\n" + heats ) print("\nCollisions:\n" + "\n".join(f"{heat} {rod}" for heat, rod in collisions.items())) print("\nCombination:\n" + "\n\n".join(f"({rod}):\n" + "\n".join(f"{heat} = {sum(heat)}" for heat in heats) for rod, heats in heats_combo.items() if rod != 0)) print("\nExpanded Regex:\n" + "\n".join(f"{expression}" for rod, expression in regex.items()) + "\n" + "\n".join(regex_mem_lock))
First expression goes in the regex with capture group output: n while the second goes in the other regex that has output:0, false output: 1
1 Comments
Rendoe  [author] 21 Dec, 2024 @ 9:40pm