Challenge Strategies¶
Strategies that control when warriors challenge for domain leadership.
AlwaysChallenge¶
orc.strategies.always.AlwaysChallenge
¶
Strategy that always challenges when eligible.
Use this for aggressive agents that want to maximize their chances of gaining leadership.
Source code in orc/strategies/always.py
should_challenge(domain, warlord_name, warlord_reputation, challenger_reputation)
¶
ReputationBased¶
orc.strategies.reputation.ReputationBased
¶
Strategy that challenges when reputation exceeds the Warlord's.
Only challenges when the agent has a meaningful reputation advantage over the current Warlord.
Example
strategy = ReputationBased(threshold=0.1)
Will challenge if challenger_rep > warlord_rep + 0.1¶
Source code in orc/strategies/reputation.py
__init__(threshold=0.1)
¶
Initialize the strategy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
threshold
|
float
|
Minimum reputation advantage required to challenge. |
0.1
|
should_challenge(domain, warlord_name, warlord_reputation, challenger_reputation)
¶
Challenge if reputation exceeds threshold.
Source code in orc/strategies/reputation.py
CooldownStrategy¶
orc.strategies.cooldown.CooldownStrategy
¶
Strategy with cooldown after losses.
Reduces challenge frequency after losses to avoid wasting resources on unlikely wins.
Example
strategy = CooldownStrategy( base_cooldown=300, # 5 minutes loss_multiplier=2.0, # Double cooldown after each loss )
Source code in orc/strategies/cooldown.py
__init__(base_cooldown=300, loss_multiplier=2.0, max_cooldown=3600)
¶
Initialize the strategy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_cooldown
|
int
|
Base cooldown in seconds. |
300
|
loss_multiplier
|
float
|
Cooldown multiplier after each loss. |
2.0
|
max_cooldown
|
int
|
Maximum cooldown in seconds. |
3600
|
Source code in orc/strategies/cooldown.py
record_loss(domain)
¶
record_win(domain)
¶
should_challenge(domain, warlord_name, warlord_reputation, challenger_reputation)
¶
Challenge if cooldown has expired.
Source code in orc/strategies/cooldown.py
SpecialistStrategy¶
orc.strategies.specialist.SpecialistStrategy
¶
Strategy that only challenges in specialty domains.
For agents that want to focus on specific domains rather than competing broadly.
Example
strategy = SpecialistStrategy(specialties=["data", "analytics"])
Will only challenge in "data" and "analytics" domains¶
Source code in orc/strategies/specialist.py
__init__(specialties=None, min_reputation=0.3)
¶
Initialize the strategy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
specialties
|
Optional[List[str]]
|
List of specialty domains. If None, never challenges. |
None
|
min_reputation
|
float
|
Minimum reputation required to challenge. |
0.3
|
Source code in orc/strategies/specialist.py
add_specialty(domain)
¶
remove_specialty(domain)
¶
should_challenge(domain, warlord_name, warlord_reputation, challenger_reputation)
¶
Challenge only in specialty domains with sufficient reputation.
Source code in orc/strategies/specialist.py
ChallengeStrategy (Base Protocol)¶
orc.strategies.base.ChallengeStrategy
¶
Bases: Protocol
Protocol for challenge strategies.
Strategies determine when an agent should challenge the current Warlord for leadership of a domain.
Source code in orc/strategies/base.py
should_challenge(domain, warlord_name, warlord_reputation, challenger_reputation)
¶
Determine whether to challenge.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
domain
|
str
|
The domain in question. |
required |
warlord_name
|
str
|
Name of the current Warlord. |
required |
warlord_reputation
|
float
|
Warlord's reputation in this domain. |
required |
challenger_reputation
|
float
|
Challenger's reputation in this domain. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the agent should challenge, False otherwise. |