public abstract class AbstractCustomer extends Object
| Modifier and Type | Field and Description |
|---|---|
protected List<CustomerInfo> |
allCustomerInfos |
protected HashMap<PowerType,List<CustomerInfo>> |
customerInfos |
protected static org.apache.logging.log4j.Logger |
log |
protected String |
name |
protected RandomSeed |
rs1
Random Number Generator
|
protected CustomerServiceAccessor |
service |
| Constructor and Description |
|---|
AbstractCustomer()
Default constructor, requires explicit setting of name
|
AbstractCustomer(String name)
Abstract Customer constructor with explicit name.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCustomerInfo(CustomerInfo info)
Adds an additional CustomerInfo to the list
|
void |
changeSubscription(Tariff tariff,
Tariff newTariff,
CustomerInfo customer)
In this overloaded implementation of the changing subscription function,
Here we just put the tariff we want to change and the whole population is
moved to another random tariff.
|
abstract void |
evaluateTariffs(List<Tariff> tariffs)
Called to evaluate tariffs.
|
List<TariffSubscription> |
getCurrentSubscriptions()
Returns the current tariff subscriptions for the first CustomerInfo.
|
List<TariffSubscription> |
getCurrentSubscriptions(PowerType type)
Returns the current tariff subscriptions for the first CustomerInfo
with the given PowerType.
|
long |
getCustId() |
CustomerInfo |
getCustomerInfo(PowerType pt)
Returns the first CustomerInfo associated with this instance and PowerType.
|
List<CustomerInfo> |
getCustomerInfoList(PowerType pt)
Returns the list of CustomerInfos associated with this instance and
PowerType.
|
List<CustomerInfo> |
getCustomerInfos()
Returns the list of CustomerInfo records associated with this customer
model.
|
long |
getId()
Synonym for getCustId()
|
String |
getName()
Returns the name of this model
|
int |
getPopulation(CustomerInfo customer) |
void |
initialize()
Initializes the instance.
|
protected org.joda.time.Instant |
lastSunday() |
protected org.joda.time.Instant |
nextStartOfDay() |
void |
saveBootstrapState()
Saves model data to the bootstrap record.
|
void |
setName(String name)
Sets the name for this model
|
void |
setServiceAccessor(CustomerServiceAccessor csa)
Provides a reference to the service accessor, through which we can get
at sim services
|
void |
setTariffMarket(TariffMarket service) |
protected org.joda.time.Instant |
startOfDay() |
abstract void |
step()
Called to run the model forward one step.
|
String |
toString() |
protected static org.apache.logging.log4j.Logger log
protected String name
protected HashMap<PowerType,List<CustomerInfo>> customerInfos
protected List<CustomerInfo> allCustomerInfos
protected CustomerServiceAccessor service
protected RandomSeed rs1
public AbstractCustomer()
public AbstractCustomer(String name)
public void setServiceAccessor(CustomerServiceAccessor csa)
public void initialize()
public void saveBootstrapState()
public void addCustomerInfo(CustomerInfo info)
public CustomerInfo getCustomerInfo(PowerType pt)
public List<CustomerInfo> getCustomerInfoList(PowerType pt)
public List<CustomerInfo> getCustomerInfos()
public List<TariffSubscription> getCurrentSubscriptions()
public List<TariffSubscription> getCurrentSubscriptions(PowerType type)
public int getPopulation(CustomerInfo customer)
public long getCustId()
public long getId()
public void setName(String name)
public String getName()
public abstract void step()
public abstract void evaluateTariffs(List<Tariff> tariffs)
protected org.joda.time.Instant lastSunday()
protected org.joda.time.Instant startOfDay()
protected org.joda.time.Instant nextStartOfDay()
public void setTariffMarket(TariffMarket service)
public void changeSubscription(Tariff tariff, Tariff newTariff, CustomerInfo customer)
tariff - Copyright © 2017 Power TAC. All rights reserved.