File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
src/main/java/com/thealgorithms/scheduling Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -44,13 +44,24 @@ public void addAgent(String agentName) {
44
44
agents .putIfAbsent (agentName , new Agent (agentName ));
45
45
}
46
46
47
+ /**
48
+ * Assign a task to a specific agent.
49
+ *
50
+ * @param agentName the name of the agent
51
+ * @param task the task to be assigned
52
+ */
47
53
public void assignTask (String agentName , String task ) {
48
54
Agent agent = agents .get (agentName );
49
55
if (agent != null ) {
50
56
agent .addTask (task );
51
57
}
52
58
}
53
59
60
+ /**
61
+ * Get the scheduled tasks for each agent.
62
+ *
63
+ * @return a map of agent names to their scheduled tasks
64
+ */
54
65
public Map <String , List <String >> getScheduledTasks () {
55
66
Map <String , List <String >> schedule = new HashMap <>();
56
67
for (Agent agent : agents .values ()) {
You can’t perform that action at this time.
0 commit comments