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) {
4444 agents .putIfAbsent (agentName , new Agent (agentName ));
4545 }
4646
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+ */
4753 public void assignTask (String agentName , String task ) {
4854 Agent agent = agents .get (agentName );
4955 if (agent != null ) {
5056 agent .addTask (task );
5157 }
5258 }
5359
60+ /**
61+ * Get the scheduled tasks for each agent.
62+ *
63+ * @return a map of agent names to their scheduled tasks
64+ */
5465 public Map <String , List <String >> getScheduledTasks () {
5566 Map <String , List <String >> schedule = new HashMap <>();
5667 for (Agent agent : agents .values ()) {
You can’t perform that action at this time.
0 commit comments