Skip to content

Commit

Permalink
Lower I/O event probability in Easy and Normal difficulty levels (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
plbrault authored Sep 3, 2023
1 parent 465c076 commit f13cddb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/difficulty_levels.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
'num_processes_at_startup': 14,
'num_ram_rows': 8,
'new_process_probability': 0.05,
'io_probability': 0.05
'io_probability': 0.01
}
}

Expand All @@ -16,7 +16,7 @@
'num_processes_at_startup': 14,
'num_ram_rows': 5,
'new_process_probability': 0.05,
'io_probability': 0.1
'io_probability': 0.05
}
}

Expand Down
11 changes: 8 additions & 3 deletions src/game_objects/custom_settings_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ def __init__(self, start_fn, cancel_fn, default_config=None):
self.children.append(self._new_process_probability_selector)

self._io_probability_selector = OptionSelector(
[str(i) + ' %' for i in range(0, 55, 5)])
['0 %', '1 %']
+
[str(i) + ' %' for i in range(5, 55, 5)]
)
self._io_probability_selector.selected_option = str(
int(self._config['io_probability'] * 100)) + ' %'
self.children.append(self._io_probability_selector)
Expand Down Expand Up @@ -63,8 +66,10 @@ def config(self):
self._num_ram_rows_selector.selected_option),
'new_process_probability': self._new_process_probability_selector.selected_option_id *
0.05,
'io_probability': self._io_probability_selector.selected_option_id *
0.05}
'io_probability': [
0, 0.01, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5
][self._io_probability_selector.selected_option_id]
}
return config

def update(self, current_time, events):
Expand Down

0 comments on commit f13cddb

Please sign in to comment.