@Test public void testInit () { init(); verify(mockSeedRepo).getRandomSeed(eq(CpGenco.class.getName()), anyLong(), eq("bid")); double[] ca = genco.getCoefficientArray(); assertNotNull(ca, "initialized array"); assertEquals(3, ca.length, "3 elements"); assertEquals(0.007, ca[0], 1e-6, "correct 1st coeff"); assertEquals(0.1, ca[1], 1e-6, "correct 1st coeff"); assertEquals(16.0, ca[2], 1e-6, "correct 1st coeff"); }
public void init (BrokerProxy proxy, int seedId, RandomSeedRepo randomSeedRepo, TimeslotRepo timeslotRepo) { log.info("init(" + seedId + ") " + getUsername()); this.brokerProxyService = proxy; this.timeslotRepo = timeslotRepo; this.seed = randomSeedRepo.getRandomSeed(CpGenco.class.getName(), seedId, "bid"); normal01 = new NormalDistribution(0.0, 1.0); normal01.reseedRandomGenerator(seed.nextLong()); if (!function.validateCoefficients(coefficients)) log.error("wrong number of coefficients for quadratic"); int to = Competition.currentCompetition().getTimeslotsOpen(); timeslotCoefficients = new double[to][getCoefficients().size()]; }
CpGenco extends Broker { public void init (BrokerProxy proxy, int seedId, RandomSeedRepo randomSeedRepo, TimeslotRepo timeslotRepo) { log.info("init(" + seedId + ") " + getUsername()); this.brokerProxyService = proxy; this.timeslotRepo = timeslotRepo; this.seed = randomSeedRepo.getRandomSeed(CpGenco.class.getName(), seedId, "bid"); normal01 = new NormalDistribution(0.0, 1.0); normal01.reseedRandomGenerator(seed.nextLong()); if (!function.validateCoefficients(coefficients)) log.error("wrong number of coefficients for quadratic"); int to = Competition.currentCompetition().getTimeslotsOpen(); timeslotCoefficients = new double[to][getCoefficients().size()]; } }
CpGenco extends Broker { public void init (BrokerProxy proxy, int seedId, RandomSeedRepo randomSeedRepo, TimeslotRepo timeslotRepo) { log.info("init(" + seedId + ") " + getUsername()); this.brokerProxyService = proxy; this.timeslotRepo = timeslotRepo; this.seed = randomSeedRepo.getRandomSeed(CpGenco.class.getName(), seedId, "bid"); normal01 = new NormalDistribution(0.0, 1.0); normal01.reseedRandomGenerator(seed.nextLong()); if (!function.validateCoefficients(coefficients)) log.error("wrong number of coefficients for quadratic"); int to = Competition.currentCompetition().getTimeslotsOpen(); timeslotCoefficients = new double[to][getCoefficients().size()]; } CpGenco(String username); }
CpGenco extends Broker { public void init (BrokerProxy proxy, int seedId, RandomSeedRepo randomSeedRepo, TimeslotRepo timeslotRepo) { log.info("init(" + seedId + ") " + getUsername()); this.brokerProxyService = proxy; this.timeslotRepo = timeslotRepo; this.seed = randomSeedRepo.getRandomSeed(CpGenco.class.getName(), seedId, "bid"); normal01 = new NormalDistribution(0.0, 1.0); normal01.reseedRandomGenerator(seed.nextLong()); if (!function.validateCoefficients(coefficients)) log.error("wrong number of coefficients for quadratic"); int to = Competition.currentCompetition().getTimeslotsOpen(); timeslotCoefficients = new double[to][getCoefficients().size()]; } CpGenco(String username); void init(BrokerProxy proxy, int seedId,
                    RandomSeedRepo randomSeedRepo,
                    TimeslotRepo timeslotRepo); void generateOrders(Instant now, List<Timeslot> openSlots); void saveBootstrapState(ServerConfiguration serverConfig); List<String> getCoefficients(); double[] getCoefficientArray(); @ConfigurableValue(valueType = "List", bootstrapState = true, dump=false, description = "Coefficients for the specified function type") @StateChange CpGenco withCoefficients(List<String> coeff); double getPSigma(); @ConfigurableValue(valueType = "Double", dump=false, description = "Standard Deviation ratio for bid price") @StateChange CpGenco withPSigma(double var); double getQSigma(); @ConfigurableValue(valueType = "Double", dump=false, description = "Standard Deviation ratio for bid quantity") @StateChange CpGenco withQSigma(double var); double getRwaSigma(); @ConfigurableValue(valueType = "Double", dump=false, description = "Random-walk std dev ratio for quadratic coefficient") @StateChange CpGenco withRwaSigma(double var); double getRwaOffset(); @ConfigurableValue(valueType = "Double", dump=false, description = "Random-walk offset ratio for quadratic coefficient") @StateChange CpGenco withRwaOffset(double var); double getRwcSigma(); @ConfigurableValue(valueType = "Double", dump=false, description = "Random-walk std dev ratio for constant coefficient") @StateChange CpGenco withRwcSigma(double var); double getRwcOffset(); @ConfigurableValue(valueType = "Double", dump=false, description = "Random-walk offset ratio for constant coefficient") @StateChange CpGenco withRwcOffset(double var); double getPriceInterval(); @ConfigurableValue(valueType = "Double", description = "Nominal price interval between successive bids") @StateChange CpGenco withPriceInterval(double interval); double getMinQuantity(); @ConfigurableValue(valueType = "Double", description = "minimum leadtime for first commitment, in hours") @StateChange CpGenco withMinQuantity(double qty); double getKneeDemand(); @ConfigurableValue(valueType = "Double", description = "congestion demand threshold") @StateChange CpGenco withKneeDemand(double demand); double getKneeSlope(); @ConfigurableValue(valueType = "Double", description = "congestion demand slope multiplier") @StateChange CpGenco withKneeSlope(double mult); }
CpGenco extends Broker { public void init (BrokerProxy proxy, int seedId, RandomSeedRepo randomSeedRepo, TimeslotRepo timeslotRepo) { log.info("init(" + seedId + ") " + getUsername()); this.brokerProxyService = proxy; this.timeslotRepo = timeslotRepo; this.seed = randomSeedRepo.getRandomSeed(CpGenco.class.getName(), seedId, "bid"); normal01 = new NormalDistribution(0.0, 1.0); normal01.reseedRandomGenerator(seed.nextLong()); if (!function.validateCoefficients(coefficients)) log.error("wrong number of coefficients for quadratic"); int to = Competition.currentCompetition().getTimeslotsOpen(); timeslotCoefficients = new double[to][getCoefficients().size()]; } CpGenco(String username); void init(BrokerProxy proxy, int seedId,
                    RandomSeedRepo randomSeedRepo,
                    TimeslotRepo timeslotRepo); void generateOrders(Instant now, List<Timeslot> openSlots); void saveBootstrapState(ServerConfiguration serverConfig); List<String> getCoefficients(); double[] getCoefficientArray(); @ConfigurableValue(valueType = "List", bootstrapState = true, dump=false, description = "Coefficients for the specified function type") @StateChange CpGenco withCoefficients(List<String> coeff); double getPSigma(); @ConfigurableValue(valueType = "Double", dump=false, description = "Standard Deviation ratio for bid price") @StateChange CpGenco withPSigma(double var); double getQSigma(); @ConfigurableValue(valueType = "Double", dump=false, description = "Standard Deviation ratio for bid quantity") @StateChange CpGenco withQSigma(double var); double getRwaSigma(); @ConfigurableValue(valueType = "Double", dump=false, description = "Random-walk std dev ratio for quadratic coefficient") @StateChange CpGenco withRwaSigma(double var); double getRwaOffset(); @ConfigurableValue(valueType = "Double", dump=false, description = "Random-walk offset ratio for quadratic coefficient") @StateChange CpGenco withRwaOffset(double var); double getRwcSigma(); @ConfigurableValue(valueType = "Double", dump=false, description = "Random-walk std dev ratio for constant coefficient") @StateChange CpGenco withRwcSigma(double var); double getRwcOffset(); @ConfigurableValue(valueType = "Double", dump=false, description = "Random-walk offset ratio for constant coefficient") @StateChange CpGenco withRwcOffset(double var); double getPriceInterval(); @ConfigurableValue(valueType = "Double", description = "Nominal price interval between successive bids") @StateChange CpGenco withPriceInterval(double interval); double getMinQuantity(); @ConfigurableValue(valueType = "Double", description = "minimum leadtime for first commitment, in hours") @StateChange CpGenco withMinQuantity(double qty); double getKneeDemand(); @ConfigurableValue(valueType = "Double", description = "congestion demand threshold") @StateChange CpGenco withKneeDemand(double demand); double getKneeSlope(); @ConfigurableValue(valueType = "Double", description = "congestion demand slope multiplier") @StateChange CpGenco withKneeSlope(double mult);  }