Class Gate

Object
akka.javasdk.testkit.eval.Gate

public final class Gate extends Object
What a batch run must satisfy, checked over all attempts. An attempt is one case in one run, so with Experiment.repeat(int) every gate counts each case once per run.

A real model is not deterministic, so a batch asserts on rates rather than on every case. With a mocked model leave the gate out: without one every case must pass.

An attempt passes only when every result passed. An attempt with an inconclusive result, or with no result, is inconclusive. It never passes: it fails allCasesShouldPass() and counts against the rate of passRateShouldBeAtLeast(double).

  • Method Details

    • allCasesShouldPass

      public static Gate allCasesShouldPass()
      Every case must pass in every run, with every result passed. An inconclusive attempt fails the gate. The gate that applies when none is given.
    • passRateShouldBeAtLeast

      public static Gate passRateShouldBeAtLeast(double minimumRate)
      The share of attempts that passed must be at least minimumRate. An inconclusive attempt counts against the rate.
    • passRateShouldBeAtLeast

      public static Gate passRateShouldBeAtLeast(Class<? extends Evaluator> evaluator, double minimumRate)
      The pass rate of one evaluator, over the attempts where it was conclusive, must be at least minimumRate. Fails when the evaluator judged no attempt.
      Parameters:
      evaluator - the evaluator's class. The built-ins are nested in Evaluators, for example Evaluators.ToolArgument.class
      Throws:
      IllegalArgumentException - when the class does not carry a valid EvalLabel
    • targetShouldNotFail

      public static Gate targetShouldNotFail()
      No attempt may fail while its recorded calls are loaded or in the agent call.
    • and

      public Gate and(Gate other)
      Both must hold.