Commit adf69ddf authored by Nicola Gatto's avatar Nicola Gatto
Browse files

Add convenient methods for configuration

parent 18344e12
Pipeline #162444 failed with stages
......@@ -102,4 +102,22 @@ public class ConfigurationSymbol extends CommonScopeSpanningSymbol {
return this.entryMap.containsKey("learning_method")
? (LearningMethod)this.entryMap.get("learning_method").getValue().getValue() : LearningMethod.SUPERVISED;
}
public boolean isReinforcementLearningMethod() {
return getLearningMethod().equals(LearningMethod.REINFORCEMENT);
}
public boolean hasCritic() {
return getEntryMap().containsKey("critic");
}
public Optional<String> getCriticName() {
if (!hasCritic()) {
return Optional.empty();
}
final Object criticNameValue = getEntry("critic").getValue().getValue();
assert criticNameValue instanceof String;
return Optional.of((String)criticNameValue);
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment