/** * Saves state of EvCustomer instances */ @Override public void saveBootstrapState () { service.getServerConfiguration().saveBootstrapState(evCustomers); }
/** * Configures this instance from the given configuration service. */ public void configure (ServerConfiguration configSource) { serverConfiguration = configSource; configSource.configureMe(this); }
/** This method must be called in the per-game initialization code in each * implementing class. This is where the timeslot phase registration gets * done. */ protected void init () { competitionControlService.registerTimeslotPhase(this, timeslotPhase); }
@Override public String initialize (Competition competition, List<String> completedInits) { incoming.clear(); serverProps.configureMe(this); brokerProxyService.registerBrokerMessageListener(this, Order.class); super.init(); serverProps.publishConfiguration(this); return "Auctioneer"; }
/** * Computes actual distribution and balancing costs by random selection */ @Override public String initialize (Competition competition, List<String> completedInits) { super.init(); balancingCost = null; serverProps.configureMe(this); if (null == balancingCost) balancingCost = 0D; log.info("Configured BM: balancing cost = " + balancingCost + ", (pPlus',pMinus') = (" + pPlusPrime + "," + pMinusPrime + ")"); serverProps.publishConfiguration(this); return "BalancingMarket"; }
@Override public String initialize (Competition competition, List<String> completedInits) { super.init(); pendingEconomicControls.clear(); return "CapacityControl"; }
/** * Initializes the instance. Called after configuration, and after * a call to setServices(). * TODO -- do we really want this here? */ public void initialize () { rs1 = service.getRandomSeedRepo().getRandomSeed(name, 0, "TariffChooser"); }
/** * Returns the current tariff subscriptions for the first CustomerInfo. * Useful for customer models with a single CustomerInfo. */ public List<TariffSubscription> getCurrentSubscriptions () { return service.getTariffSubscriptionRepo(). findActiveSubscriptionsForCustomer(allCustomerInfos.get(0)); }
/** * Removes customerCount customers (at most) from this subscription, * posts early-withdrawal fees if appropriate. */ public void unsubscribe (int customerCount) { getTariffMarket().subscribeToTariff(getTariff(), getCustomer(), -customerCount); pendingUnsubscribeCount += customerCount; }
@Override public void saveBootstrapState () { serverConfig.saveBootstrapState(models); for (AbstractCustomer model : models) { // some models have to save local state model.saveBootstrapState(); } }
private void send (TariffMessage msg) { if (null == msg) { log.debug("null outgoing message"); } else { brokerProxyService.sendMessage(msg.getBroker(), msg); } }
@Override public void routeMessage (Object message) { if (router.route(message)) { // dispatch to visualizers if (!(message instanceof TariffSpecification)) { // don't forward incoming TS; wait for publication visualizerProxyService.forwardMessage(message); } } }
/** * @deprecated * For backward-compatibility only - should not be called. */ @ConfigurableValue(valueType = "Double", dump=false, name = "balancingCost", publish = true, description = "Low end of distribution fee range") public double getBalancingCost () { return balancingMarket.getBalancingCost(); }
/** * @deprecated * For backward-compatibility only - should not be called. */ @ConfigurableValue(valueType = "Double", name = "pPlusPrime", publish = true, dump=false, description = "Slope of up-regulation cost function") public double getPPlusPrime () { return balancingMarket.getPPlusPrime(); }
/** * @deprecated * For backward-compatibility only - should not be called. */ @ConfigurableValue(valueType = "Double", name = "pMinusPrime", publish = true, dump=false, description = "slope of down-regulation cost function") public double getPMinusPrime() { return balancingMarket.getPMinusPrime(); }
/** * @deprecated * For backward-compatibility only - should not be called. */ @ConfigurableValue(valueType = "Double", name = "defaultSpotPrice", publish = true, dump=false, description = "value used for spot price/MWh if unavailable from market") public double getDefaultSpotPrice() { return balancingMarket.getDefaultSpotPrice(); }
@Override public String initialize (Competition competition, List<String> completedInits) { serverConfig.configureMe(this); if (remoteVisualizer) { // set up the output queue log.info("Remote visualizer on queue " + visualizerQueueName); jmsManagementService.createQueue(visualizerQueueName); } return "VisualizerProxy"; }
private void ensureSeeds () { if (null == evalSeed) { evalSeed = service.getRandomSeedRepo() .getRandomSeed(Battery.class.getName() + "-" + name, 0, "eval"); } }
@Override public void sendMessage (Broker broker, Object messageObject) { // dispatch to visualizers, but only if we're actually going to send // to the broker. if (broker.isEnabled()) visualizerProxyService.forwardMessage(messageObject); localSendMessage(broker, messageObject); }
public void start () { // pull down configuration - this will later change when configuration // available from web-app serverPropertiesService.configureMe(this); if (isServingJms()) { startProvider(); } initializeClientInterface(); }