Package org.powertac.genco
Class SimpleGencoService
- java.lang.Object
-
- org.powertac.common.interfaces.TimeslotPhaseProcessor
-
- org.powertac.genco.SimpleGencoService
-
- All Implemented Interfaces:
BootstrapState,ContextService,InitializationService,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
@Service public class SimpleGencoService extends TimeslotPhaseProcessor implements ContextService, InitializationService, BootstrapState
Very simple service that operates wholesale market actors, activated by theCompetitionControlServiceonce each timeslot.- Author:
- John Collins
-
-
Constructor Summary
Constructors Constructor Description SimpleGencoService()Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate(org.joda.time.Instant now, int phase)Called once/timeslot, simply calls updateModel() and generateOrders() on each of the gencos.ObjectgetBean(String beanName)Retrieves a Spring component instance by namevoidinit(List<Genco> gencos)Simply receives and stores the list of genco and buyer instances generated by the initialization service.Stringinitialize(Competition competition, List<String> completedInits)Creates the gencos and the buyer using the server configuration service.voidsaveBootstrapState()Saves state at the conclusion of a bootstrap session as configuration items.voidsetApplicationContext(org.springframework.context.ApplicationContext appContext)-
Methods inherited from class org.powertac.common.interfaces.TimeslotPhaseProcessor
init, setTimeslotPhase
-
-
-
-
Method Detail
-
initialize
public String initialize(Competition competition, List<String> completedInits)
Creates the gencos and the buyer using the server configuration service.- Specified by:
initializein interfaceInitializationService
-
init
public void init(List<Genco> gencos)
Simply receives and stores the list of genco and buyer instances generated by the initialization service.
-
activate
public void activate(org.joda.time.Instant now, int phase)Called once/timeslot, simply calls updateModel() and generateOrders() on each of the gencos.- Specified by:
activatein classTimeslotPhaseProcessor
-
saveBootstrapState
public void saveBootstrapState()
Description copied from interface:BootstrapStateSaves state at the conclusion of a bootstrap session as configuration items. State can then be restored at the beginning of the sim session through the normal configuration process. The usual way to save state is to call ServerPropertiesService.saveBootstrapState(arg), where arg is either a single configurable object (configured with configureMe() or configureSingleton()), or a list of objects annotated withConfigurableInstance.- Specified by:
saveBootstrapStatein interfaceBootstrapState
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext appContext) throws org.springframework.beans.BeansException- Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
getBean
public Object getBean(String beanName)
Retrieves a Spring component instance by name- Specified by:
getBeanin interfaceContextService
-
-