add: Agent Actions

This commit is contained in:
h z
2025-02-12 14:09:56 +00:00
parent f7da4ee8bb
commit 2323211a65
8 changed files with 127 additions and 30 deletions

View File

@@ -1,28 +1,17 @@
namespace Polonium.Agents;
public abstract class AgentDecisionMaker<TAgent, TAgentDecisionMaker, TAgentKnowledge>
where TAgent : Agent<TAgent, TAgentDecisionMaker, TAgentKnowledge>
where TAgentDecisionMaker : AgentDecisionMaker<TAgent, TAgentDecisionMaker, TAgentKnowledge>, new()
where TAgentKnowledge : AgentKnowledge<TAgent, TAgentDecisionMaker, TAgentKnowledge>, new()
public abstract class AgentDecisionMaker<TAgent, TAgentDecisionMaker, TAgentKnowledge, TAgentAction>(DecisionMakerType type)
where TAgent : Agent<TAgent, TAgentDecisionMaker, TAgentKnowledge, TAgentAction>, new()
where TAgentDecisionMaker : AgentDecisionMaker<TAgent, TAgentDecisionMaker, TAgentKnowledge, TAgentAction>, new()
where TAgentKnowledge : AgentKnowledge<TAgent, TAgentDecisionMaker, TAgentKnowledge, TAgentAction>, new()
where TAgentAction : AgentAction<TAgent, TAgentDecisionMaker, TAgentKnowledge, TAgentAction>, new()
{
public enum DecisionMakerType
{
None = 0,
Player = 1,
Computer = 2,
Global = 3,
}
public DecisionMakerType Type { get; init; }
public AgentDecisionMaker()
{
Type = DecisionMakerType.Computer;
}
public AgentDecisionMaker(DecisionMakerType type)
public DecisionMakerType Type { get; init; } = type;
public AgentDecisionMaker() : this(DecisionMakerType.Computer)
{
Type = type;
}
}