org.powertac.visualizer.domain.broker
Class BrokerModel

java.lang.Object
  extended by org.powertac.visualizer.domain.broker.BrokerModel
All Implemented Interfaces:
DisplayableBroker, TimeslotModelUpdate, VisualBroker

public class BrokerModel
extends Object
implements VisualBroker, DisplayableBroker, TimeslotModelUpdate


Constructor Summary
BrokerModel(String name, Appearance appearance)
           
 
Method Summary
 void addBalancingTransaction(org.powertac.common.BalancingTransaction balancingTransaction)
           
 void addTariffSpecification(org.powertac.common.TariffSpecification tariffSpecification)
           
 void addTariffTransaction(org.powertac.common.TariffTransaction tariffTransaction)
           
 void buildCustomersBubble()
          Builds customers bubble JSON Array.
 Appearance getAppearance()
           
 List<org.powertac.common.BalancingTransaction> getBalancingTransactions()
           
 double getCashBalance()
           
 DayState getCurrentDayState()
           
 int getCustomerCount()
           
 Set<CustomerModel> getCustomerModels()
           
 HashMap<Integer,DayState> getDayStates()
           
 DayState getDisplayableDayState()
           
 double getEnergyBalance()
           
 String getId()
           
 BrokerJSON getJson()
           
 String getName()
           
 HashMap<Long,TariffInfo> getTariffInfoMaps()
           
 ArrayList<TariffInfo> getTariffInfos()
           
 void setAppereance(Appearance appearance)
           
 void setCashBalance(double cashBalance)
           
 void setCustomerModels(Set<CustomerModel> customerModels)
           
 void setEnergyBalance(double energyBalance)
           
 void setName(String name)
           
 void update(int timeslotIndex, org.joda.time.Instant postedTime)
           
 void updateCashBalance(double balance)
           
 void updateEnergyBalance(double balance)
          Method for updating energy balance in case broker didn't receive balancing transaction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BrokerModel

public BrokerModel(String name,
                   Appearance appearance)
Method Detail

updateCashBalance

public void updateCashBalance(double balance)
Specified by:
updateCashBalance in interface VisualBroker

updateEnergyBalance

public void updateEnergyBalance(double balance)
Method for updating energy balance in case broker didn't receive balancing transaction

Parameters:
balance -

addBalancingTransaction

public void addBalancingTransaction(org.powertac.common.BalancingTransaction balancingTransaction)
Specified by:
addBalancingTransaction in interface VisualBroker

addTariffSpecification

public void addTariffSpecification(org.powertac.common.TariffSpecification tariffSpecification)
Specified by:
addTariffSpecification in interface VisualBroker

addTariffTransaction

public void addTariffTransaction(org.powertac.common.TariffTransaction tariffTransaction)
Specified by:
addTariffTransaction in interface VisualBroker

setCustomerModels

public void setCustomerModels(Set<CustomerModel> customerModels)
Specified by:
setCustomerModels in interface VisualBroker

getName

public String getName()
Specified by:
getName in interface DisplayableBroker
Specified by:
getName in interface VisualBroker

setName

public void setName(String name)

getAppearance

public Appearance getAppearance()
Specified by:
getAppearance in interface DisplayableBroker
Specified by:
getAppearance in interface VisualBroker

setAppereance

public void setAppereance(Appearance appearance)

buildCustomersBubble

public void buildCustomersBubble()
Builds customers bubble JSON Array. Visibility is set to public to enhance testability.


getCashBalance

public double getCashBalance()
Specified by:
getCashBalance in interface VisualBroker

setCashBalance

public void setCashBalance(double cashBalance)

getEnergyBalance

public double getEnergyBalance()
Specified by:
getEnergyBalance in interface VisualBroker

setEnergyBalance

public void setEnergyBalance(double energyBalance)

getDisplayableDayState

public DayState getDisplayableDayState()
Specified by:
getDisplayableDayState in interface DisplayableBroker

getBalancingTransactions

public List<org.powertac.common.BalancingTransaction> getBalancingTransactions()

getCustomerModels

public Set<CustomerModel> getCustomerModels()

getDayStates

public HashMap<Integer,DayState> getDayStates()

getId

public String getId()
Specified by:
getId in interface DisplayableBroker

getCustomerCount

public int getCustomerCount()

getCurrentDayState

public DayState getCurrentDayState()

update

public void update(int timeslotIndex,
                   org.joda.time.Instant postedTime)
Specified by:
update in interface TimeslotModelUpdate
Parameters:
timeslotIndex - update will be run for this timeslot index.

getJson

public BrokerJSON getJson()

getTariffInfoMaps

public HashMap<Long,TariffInfo> getTariffInfoMaps()

getTariffInfos

public ArrayList<TariffInfo> getTariffInfos()


Copyright © 2012 Power TAC. All Rights Reserved.