-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor EpsilonGreedyAgentBase and concretions to improve encapsulation
In this commit, encapsulation in the EpsilonGreedyAgentBase and its concretions (EpsilonGreedyAgent and AlphaEpsilonGreedyAgent) has been improved. The 'action_size' parameter has been removed from the base class' constructor and each child class is now responsible for initializing its own 'action_values' array. New getter method 'action_values' has been added to the base class which is abstract and must be implemented by all child classes. This improves the encapsulation by making 'action_values' private and only accessible through its getter. This change also avoids the need for type checking in 'base.py'. Although 'action_size' now needs to be provided in each concretion, it ensures that the implementations have proper control over their 'action_values' and makes the code more in line with OOP principles.
- Loading branch information
1 parent
0a708f6
commit f77b9e4
Showing
3 changed files
with
38 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters