Skip to content

Commit

Permalink
remove UpdateAgentInternalState
Browse files Browse the repository at this point in the history
  • Loading branch information
MattSScott committed Oct 17, 2024
1 parent dd9745d commit e4028d7
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 28 deletions.
4 changes: 0 additions & 4 deletions internal/testUtils/testUtilsAgent.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ type TestServerFunctionsAgent struct {
*agent.BaseAgent[ITestBaseAgent]
}

func (ta *TestServerFunctionsAgent) UpdateAgentInternalState() {
ta.Counter += 1
}

func (ta *TestServerFunctionsAgent) FinishedMessaging() {
ta.StoppedTalking++
ta.NotifyAgentFinishedMessaging()
Expand Down
2 changes: 0 additions & 2 deletions pkg/agent/agentInterface.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,4 @@ type IAgent[T any] interface {
IMessagingFunctions[T]
// returns the unique ID of an agent
GetID() uuid.UUID
// allows agent to update their internal state
UpdateAgentInternalState()
}
20 changes: 0 additions & 20 deletions pkg/agent/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,6 @@ func TestNilInterfaceInjection(t *testing.T) {
ag.GetID()
}

func TestUpdateAgentInternalState(t *testing.T) {
var testServ agent.IExposedServerFunctions[testUtils.ITestBaseAgent] = &testUtils.TestServer{
BaseServer: server.CreateServer[testUtils.ITestBaseAgent](1, 1, time.Second, 100),
TurnCounter: 0,
IterationStartCounter: 0,
IterationEndCounter: 0,
}
ag := testUtils.TestServerFunctionsAgent{
BaseAgent: agent.CreateBaseAgent(testServ),
Counter: 0,
}
if ag.Counter != 0 {
t.Error("Additional agent field not correctly instantiated")
}
ag.UpdateAgentInternalState()
if ag.Counter != 1 {
t.Error("Agent state not correctly updated")
}
}

func TestCreateBaseMessage(t *testing.T) {
testServ := testUtils.GenerateTestServer(1, 1, 1, time.Second, 100000)
ag := testUtils.NewTestAgent(testServ)
Expand Down
2 changes: 0 additions & 2 deletions pkg/agent/baseAgent.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ func (a *BaseAgent[T]) CreateBaseMessage() message.BaseMessage {
return message.BaseMessage{Sender: a.GetID()}
}

func (a *BaseAgent[T]) UpdateAgentInternalState() {}

func (a *BaseAgent[T]) NotifyAgentFinishedMessaging() {
go a.AgentStoppedTalking(a.id)
}
Expand Down

0 comments on commit e4028d7

Please sign in to comment.