#2459 back-sync b8 changes into core
This commit is contained in:
@@ -103,6 +103,10 @@ class File(FileSystemItemABC):
|
||||
"""
|
||||
super().apply_timestep(timestep=timestep)
|
||||
|
||||
def pre_timestep(self, timestep: int) -> None:
|
||||
"""Apply pre-timestep logic."""
|
||||
super().pre_timestep(timestep)
|
||||
|
||||
# reset the number of accesses to 0
|
||||
self.num_access = 0
|
||||
|
||||
|
||||
@@ -427,15 +427,21 @@ class FileSystem(SimComponent):
|
||||
"""Apply time step to FileSystem and its child folders and files."""
|
||||
super().apply_timestep(timestep=timestep)
|
||||
|
||||
# apply timestep to folders
|
||||
for folder_id in self.folders:
|
||||
self.folders[folder_id].apply_timestep(timestep=timestep)
|
||||
|
||||
def pre_timestep(self, timestep: int) -> None:
|
||||
"""Apply pre-timestep logic."""
|
||||
super().pre_timestep(timestep)
|
||||
# reset number of file creations
|
||||
self.num_file_creations = 0
|
||||
|
||||
# reset number of file deletions
|
||||
self.num_file_deletions = 0
|
||||
|
||||
# apply timestep to folders
|
||||
for folder_id in self.folders:
|
||||
self.folders[folder_id].apply_timestep(timestep=timestep)
|
||||
for folder in self.folders.values():
|
||||
folder.pre_timestep(timestep)
|
||||
|
||||
###############################################################
|
||||
# Agent actions
|
||||
|
||||
@@ -128,6 +128,13 @@ class Folder(FileSystemItemABC):
|
||||
for file_id in self.files:
|
||||
self.files[file_id].apply_timestep(timestep=timestep)
|
||||
|
||||
def pre_timestep(self, timestep: int) -> None:
|
||||
"""Apply pre-timestep logic."""
|
||||
super().pre_timestep(timestep)
|
||||
|
||||
for file in self.files.values():
|
||||
file.pre_timestep(timestep)
|
||||
|
||||
def _scan_timestep(self) -> None:
|
||||
"""Apply the scan action timestep."""
|
||||
if self.scan_countdown >= 0:
|
||||
|
||||
Reference in New Issue
Block a user