public class DefaultTeamManager extends Object implements TeamManager
The default implementation of the team manager behavior that administers the members of a team. It coordinates the interaction for the following three types of functions:
Note that this behavior is indeed only responsible for coordinating the interaction. All decisions about whether a participant may join or leave the team are delegated to a matcher and a database.
Constructor and Description |
---|
DefaultTeamManager(BehaviorController controller,
TeamMatcher matcher)
Instantiates this team manager behavior with the default
MemoryTeamDatabase . |
DefaultTeamManager(BehaviorController controller,
TeamMatcher matcher,
TeamDatabase database)
Instantiates this team manager.
|
Modifier and Type | Method and Description |
---|---|
void |
dissolve()
A function to inform the team manager behavior that the team should be
dissolved.
|
boolean |
isFinished()
Indicates whether the behavior is finished or requires re-scheduling.
|
Result |
result()
Returns the result of the behavior.
|
void |
run()
The implementation of the actual behavior.
|
EventPattern |
waitingFor()
Defines the event pattern for re-scheduling.
|
public DefaultTeamManager(BehaviorController controller, TeamMatcher matcher)
MemoryTeamDatabase
.controller
- the controller of this behaviormatcher
- the team matcher for participant descriptionspublic DefaultTeamManager(BehaviorController controller, TeamMatcher matcher, TeamDatabase database)
controller
- the controller of this behaviormatcher
- the team matcher for participant descriptionsdatabase
- the team member databasepublic EventPattern waitingFor()
Behavior
waitingFor
in interface Behavior
null
if the behavior is finishedpublic void run()
Behavior
public boolean isFinished()
Behavior
isFinished
in interface Behavior
true
if the behavior is finished,
false
otherwisepublic Result result()
Behavior
Returns the result of the behavior.
Note that the result is only available if the behavior is finished. Otherwise, an illegal-state exception may be thrown.
public void dissolve()
dissolve
in interface TeamManager
Copyright © Aimpulse Intelligent Systems GmbH
All rights reserved.