sholloway / agents-playground

MIT License
4 stars 0 forks source link

Extendable Agent Characteristics #89

Open sholloway opened 10 months ago

sholloway commented 10 months ago

Make AgentCharacteristics be dynamic. Perhaps attribute driven.

The idea being that sims can extend what is included in the AgentCharacteristics class.

class MyAgentDef:
  @agent_characteristic mood: AgentMoodLike
  @agent_characteristic feelings: AgentFeelings
  @agent_characteristic state: AgentStateLike

I don't think the above makes sense. Probably need some kind of meta function to do this.

class MyAgentDef:
  def __init__(self, mood: AgentMoodLike, feelings: AgentFeelings, state: AgentStateLike):
    self.mood = agent_characteristic(mood, type_of(mood))
    self.feelings = agent_characteristic(feelings, type_of(feelings))
    self.state = agent_characteristic(state, type_of(state))