// Path: berserker-commons/src/main/java/io/smartcat/berserker/api/RateGenerator.java
// public interface RateGenerator {
// 
//     /**
//      * Returns rate per second as a function of time.
//      *
//      * @param time Relative time in nanoseconds from starting load generator.
//      * @return Rate per second as a function of time.
//      */
//     double getRate(long time);
// }


import io.smartcat.berserker.api.RateGenerator;
import io.smartcat.berserker.rategenerator.*;
import org.parboiled.BaseParser;
import org.parboiled.Rule;
import org.parboiled.support.Var;
import java.util.Map;
    public Rule term() {
        Var<Character> op = new Var<>();
        return Sequence(factor(), ZeroOrMore(ZeroOrMore(whitespace()), FirstOf("*", "/"), op.set(matchedChar()),
                ZeroOrMore(whitespace()), factor(), push(createMultiplicationOrDivisionRateGenerator(op.get()))));
    }

    /**
     * Factor definition.
     *
     * @return Factor definition rule.
     */
    public Rule factor() {
        return FirstOf(simpleRateGenerator(), function(rateGenerator()));
    }

    /**
     * Simple rate generator definition.
     *
     * @return Simple rate generator definition rule.
     */
    public Rule simpleRateGenerator() {
        return FirstOf(rateGeneratorReference(), functionRateGenerator(), constantRateGenerator());
    }

    /**
     * Returns or creates new value proxy for given name.
     *
     * @param name Name of the value proxy.
     * @return Proxy value.
     */
// Path: berserker-commons/src/main/java/io/smartcat/berserker/api/RateGenerator.java
// public interface RateGenerator {
// 
//     /**
//      * Returns rate per second as a function of time.
//      *
//      * @param time Relative time in nanoseconds from starting load generator.
//      * @return Rate per second as a function of time.
//      */
//     double getRate(long time);
// }


// Path: berserker-core/src/main/java/io/smartcat/berserker/configuration/rategenerator/RateGeneratorExpressionParser.java
import io.smartcat.berserker.api.RateGenerator;
import io.smartcat.berserker.rategenerator.*;
import org.parboiled.BaseParser;
import org.parboiled.Rule;
import org.parboiled.support.Var;
import java.util.Map;

    public Rule term() {
        Var<Character> op = new Var<>();
        return Sequence(factor(), ZeroOrMore(ZeroOrMore(whitespace()), FirstOf("*", "/"), op.set(matchedChar()),
                ZeroOrMore(whitespace()), factor(), push(createMultiplicationOrDivisionRateGenerator(op.get()))));
    }

    /**
     * Factor definition.
     *
     * @return Factor definition rule.
     */
    public Rule factor() {
        return FirstOf(simpleRateGenerator(), function(rateGenerator()));
    }

    /**
     * Simple rate generator definition.
     *
     * @return Simple rate generator definition rule.
     */
    public Rule simpleRateGenerator() {
        return FirstOf(rateGeneratorReference(), functionRateGenerator(), constantRateGenerator());
    }

    /**
     * Returns or creates new value proxy for given name.
     *
     * @param name Name of the value proxy.
     * @return Proxy value.
     */
    protected RateGenerator getRateGeneratorProxy(String name) {