pneuma-godot/script_templates/AIController/controller_template.gd

44 lines
1.3 KiB
GDScript3
Raw Permalink Normal View History

# meta-name: AI Controller Logic
# meta-description: Methods that need implementing for AI controllers
# meta-default: true
extends _BASE_
#-- Methods that need implementing using the "extend script" option in Godot --#
func get_obs() -> Dictionary:
2024-06-13 16:44:02 +00:00
assert(false, "the get_obs method is not implemented when extending from ai_controller")
return {"obs":[]}
func get_reward() -> float:
2024-06-13 16:44:02 +00:00
assert(false, "the get_reward method is not implemented when extending from ai_controller")
return 0.0
func get_action_space() -> Dictionary:
2024-06-13 16:44:02 +00:00
assert(false, "the get get_action_space method is not implemented when extending from ai_controller")
return {
"example_actions_continous" : {
"size": 2,
"action_type": "continuous"
},
"example_actions_discrete" : {
"size": 2,
"action_type": "discrete"
},
}
func set_action(action) -> void:
2024-06-13 16:44:02 +00:00
assert(false, "the get set_action method is not implemented when extending from ai_controller")
# -----------------------------------------------------------------------------#
#-- Methods that can be overridden if needed --#
#func get_obs_space() -> Dictionary:
# May need overriding if the obs space is complex
# var obs = get_obs()
# return {
# "obs": {
# "size": [len(obs["obs"])],
# "space": "box"
# },
# }