Apply suggestions from code review.

This commit is contained in:
Marek Wolan
2024-02-08 13:20:32 +00:00
parent c35c060448
commit 9b350ddd6f
2 changed files with 10 additions and 2 deletions

View File

@@ -68,6 +68,8 @@ class DummyReward(AbstractReward):
:param config: dict of options for the reward component's constructor. Should be empty. :param config: dict of options for the reward component's constructor. Should be empty.
:type config: dict :type config: dict
:return: The reward component.
:rtype: DummyReward
""" """
return cls() return cls()
@@ -230,7 +232,12 @@ class WebpageUnavailablePenalty(AbstractReward):
@classmethod @classmethod
def from_config(cls, config: dict) -> AbstractReward: def from_config(cls, config: dict) -> AbstractReward:
"""Build the reward component object from config.""" """
Build the reward component object from config.
:param config: Configuration dictionary.
:type config: Dict
"""
node_hostname = config.get("node_hostname") node_hostname = config.get("node_hostname")
return cls(node_hostname=node_hostname) return cls(node_hostname=node_hostname)

View File

@@ -307,7 +307,8 @@
"The blue agent's reward is calculated using two measures:\n", "The blue agent's reward is calculated using two measures:\n",
"1. Whether the database file is in a good state (+1 for good, -1 for corrupted, 0 for any other state)\n", "1. Whether the database file is in a good state (+1 for good, -1 for corrupted, 0 for any other state)\n",
"2. Whether each green agents' most recent webpage request was successful (+1 for a `200` return code, -1 for a `404` return code and 0 otherwise).\n", "2. Whether each green agents' most recent webpage request was successful (+1 for a `200` return code, -1 for a `404` return code and 0 otherwise).\n",
"The file status reward and the two green-agent-related reward are averaged to get a total step reward.\n" "\n",
"The file status reward and the two green-agent-related rewards are averaged to get a total step reward.\n"
] ]
}, },
{ {