AdaptiveRotationStrategy class

A rotation strategy that adapts to the performance of proxies

This strategy uses a combination of factors to select the best proxy:

  • Success rate
  • Response time
  • Uptime
  • Consecutive successes/failures
  • Time since last use
Implemented types

Constructors

AdaptiveRotationStrategy.new({double learningRate = 0.1, double explorationRate = 0.2, double minWeight = 0.1, double maxWeight = 10.0, double decayFactor = 0.99})
Creates a new AdaptiveRotationStrategy

Properties

decayFactor double
The decay factor for weights over time
final
explorationRate double
The exploration rate for trying new proxies (0.0 to 1.0)
final
hashCode int
The hash code for this object.
no setterinherited
learningRate double
The learning rate for adapting weights (0.0 to 1.0)
final
maxWeight double
The maximum weight for a proxy
final
minWeight double
The minimum weight for a proxy
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getNextProxy() Proxy?
Gets the next proxy from the internal list
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
recordFailure(Proxy proxy) → void
Records a failed request with a proxy
override
recordResult(Proxy proxy, bool success) → void
Records the result of using a proxy
recordSuccess(Proxy proxy) → void
Records a successful request with a proxy
override
selectProxy(List<Proxy> proxies) Proxy
Selects a proxy from the given list
override
toString() String
A string representation of this object.
override
updateProxies(List<Proxy> proxies) → void
Updates the internal list of proxies
override

Operators

operator ==(Object other) bool
The equality operator.
inherited