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 theCompetitionControlService
once 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 void
activate(org.joda.time.Instant now, int phase)
Called once/timeslot, simply calls updateModel() and generateOrders() on each of the gencos.Object
getBean(String beanName)
Retrieves a Spring component instance by namevoid
init(List<Genco> gencos)
Simply receives and stores the list of genco and buyer instances generated by the initialization service.String
initialize(Competition competition, List<String> completedInits)
Creates the gencos and the buyer using the server configuration service.void
saveBootstrapState()
Saves state at the conclusion of a bootstrap session as configuration items.void
setApplicationContext(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:
initialize
in 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:
activate
in classTimeslotPhaseProcessor
-
saveBootstrapState
public void saveBootstrapState()
Description copied from interface:BootstrapState
Saves 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:
saveBootstrapState
in interfaceBootstrapState
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext appContext) throws org.springframework.beans.BeansException
- Specified by:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
- Throws:
org.springframework.beans.BeansException
-
getBean
public Object getBean(String beanName)
Retrieves a Spring component instance by name- Specified by:
getBean
in interfaceContextService
-
-