Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to initialize the conflict resolution method for agents.
Agentic AI
conflict_resolver = AgentConflictManager([1]=True)
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'allow_conflicts' which would permit conflicts instead of resolving them.
Using 'conflict_mode' which is not a valid parameter.
✗ Incorrect
The parameter 'resolve_conflicts' enables the conflict resolution mechanism between agents.
2fill in blank
mediumComplete the code to detect conflicts between two agents' actions.
Agentic AI
if agent1.action [1] agent2.action: handle_conflict()
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '==' which checks if actions are the same, not conflicting.
Using 'in' or 'not in' which are not appropriate for direct action comparison.
✗ Incorrect
Conflicts occur when the actions are different, so '!=' is used to detect conflicting actions.
3fill in blank
hardFix the error in the conflict resolution function call.
Agentic AI
result = resolve_conflict(agent1, agent2, strategy=[1]) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Passing the strategy without quotes causing a NameError.
Using an undefined variable instead of a string literal.
✗ Incorrect
The strategy parameter expects a string, so the value must be in quotes.
4fill in blank
hardFill both blanks to create a dictionary mapping agents to their chosen conflict resolution strategies.
Agentic AI
strategies = {agent1: [1], agent2: [2] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using non-string values without quotes.
Assigning the same strategy to both agents.
✗ Incorrect
Assigning 'compromise' to agent1 and 'negotiation' to agent2 shows different conflict resolution strategies.
5fill in blank
hardFill all three blanks to filter conflicting agents and apply a resolution method.
Agentic AI
conflicting_agents = [agent for agent in agents if agent.status == [1]] resolution_method = [2] results = [resolution_method(agent) for agent in conflicting_agents if agent.priority [3] 5]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong status string without quotes.
Using a comparison operator that selects lower priority agents.
Passing a string instead of a function for the resolution method.
✗ Incorrect
We filter agents with status 'conflicted', use the function 'resolve_agent_conflict', and apply it only to agents with priority greater than 5.