org.powertac.common
Class CustomerInfo

java.lang.Object
  extended by org.powertac.common.CustomerInfo

public class CustomerInfo
extends Object

A CustomerInfo instance represents a customer model (i.e. a consumer or a producer) within a specific competition. The customer data stored is published to all brokers in the Competition in order to provide them with an brief overview on what type of customers participate in the specific competition. The collection of CustomerInfo instances are serialized and sent to brokers at the beginning of a game, allowing brokers to correlate tariff subscriptions and power consumption/production with individual customers.

Author:
Carsten Block, John Collins

Constructor Summary
CustomerInfo(String name, int population)
          Creates a new CustomerInfo, with no power types set.
 
Method Summary
 CustomerInfo addPowerType(PowerType type)
          Fluent setter to add PowerType flags to this CustomerInfo.
 CustomerType getCustomerType()
          Gives a "rough" classification what type of customer to expect based on the CustomerType enumeration, i.e.
 long getId()
           
 String getName()
          Display name for this CustomerInfo instance.
 int getPopulation()
          Population of the model represented by the CustomerInfo.
 ArrayList<PowerType> getPowerTypes()
          The types of power consumption and/or production modalities available in the customer model.
 boolean isCanNegotiate()
          True just in case the underlying Customer model can negotiate individual contracts.
 boolean isMultiContracting()
          True if this customer can subscribe to multiple contracts.
 void setPopulation(Integer population)
          Updates the population for the underlying model.
 String toString()
           
 CustomerInfo withCanNegotiate(boolean value)
          Fluent setter for the canNegotiate flag.
 CustomerInfo withCustomerType(CustomerType type)
          Fluent setter for customer classification.
 CustomerInfo withMultiContracting(boolean value)
          Fluent setter for the multiContracting property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CustomerInfo

public CustomerInfo(String name,
                    int population)
Creates a new CustomerInfo, with no power types set. Chain calls to addPowerType() to add the correct power types.

Method Detail

getId

public long getId()

getName

public String getName()
Display name for this CustomerInfo instance.


getPopulation

public int getPopulation()
Population of the model represented by the CustomerInfo. This is not necessarily the number of people represented, but the number of potential tariff subscribers.


setPopulation

public void setPopulation(Integer population)
Updates the population for the underlying model. Depending on when this method is called, it may or may not have any impact. There is also no guarantee that the underlying model refers to this value in any useful way.


getCustomerType

public CustomerType getCustomerType()
Gives a "rough" classification what type of customer to expect based on the CustomerType enumeration, i.e. a fixed set of customer types. Defaults to CustomerHousehold.


withCustomerType

public CustomerInfo withCustomerType(CustomerType type)
Fluent setter for customer classification.


getPowerTypes

public ArrayList<PowerType> getPowerTypes()
The types of power consumption and/or production modalities available in the customer model.


addPowerType

public CustomerInfo addPowerType(PowerType type)
Fluent setter to add PowerType flags to this CustomerInfo.


isMultiContracting

public boolean isMultiContracting()
True if this customer can subscribe to multiple contracts. This is normally true for population models, false for models of individual entities.


withMultiContracting

public CustomerInfo withMultiContracting(boolean value)
Fluent setter for the multiContracting property.


isCanNegotiate

public boolean isCanNegotiate()
True just in case the underlying Customer model can negotiate individual contracts.


withCanNegotiate

public CustomerInfo withCanNegotiate(boolean value)
Fluent setter for the canNegotiate flag. Should be called only by the model itself.


toString

public String toString()
Overrides:
toString in class Object


Copyright © 2011. All Rights Reserved.