Skip to content

TargetImproved ​

Rasuvaeff\PropertyTesting\Event\TargetImproved

Class — Package: property-testing-core — Source — Version: v1.0.0-1-g88fdee2

Implements: Event\PropertyEvent

A passing run scored better on a Target label than any before it — in the random phase or the search phase. The arguments are the input that did it, so a listener can watch the search close in on an extreme.

Constructor ​

php
__construct(
    string $propertyId,
    string $label,
    \Runner\TargetDirection $direction,
    float $score,
    ?float $previous,
    array<string,mixed> $arguments,
)
ParameterTypeDefaultDescription
$propertyIdstringrequiredThe property whose target improved.
$labelstringrequiredThe target label, as reported to Target::maximize()/minimize().
$directionRunner\TargetDirectionrequiredWhich way the label is pushed.
$scorefloatrequiredThe new best.
$previous?floatrequiredThe best before this run; null for the first score of the label.
$argumentsarray<string,mixed>requiredThe input that scored, by parameter name.