edu.ntnu.ecosim.agents.serviceproviders
Class Memory

java.lang.Object
  extended by edu.ntnu.ecosim.agents.serviceproviders.Memory

public class Memory
extends java.lang.Object

The Class Memory represents the memory of a service provider.

Author:
martin.andreas.borke

Constructor Summary
protected Memory()
          The Constructor.
 
Method Summary
protected  void addBindFeeEarnings(double earn)
          Adds bind fee earnings.
protected  void addLostSubscriber()
          Method to add a lost subscriber to the calculations
protected  void addNewSubscriber()
          Adds a new subscriber
protected  void addSubscriptionEarnings(double earn)
          Adds subscription earnings.
protected  int calculateArpu()
          Calculates the arpu for this round.
protected  int calculateChurnRate()
          Calculates the customer churn rate.
protected  void flushMemory()
          Flush memory from "short time"(periodic) to long time memory.
protected  int getLastSubscribers()
          Gets the number of subscribers from last round
protected  int getLostSubscribers()
          Gets the lost subscribers this round
protected  int getNewSubscribers()
          Gets the new subscribers this round
protected  int getProfit()
          Gets the total profit of this provider
protected  double getRoundProfit()
          Gets the round profit.
protected  int getTotalSubscribers()
          Gets the total subscribers.
protected  void registerInitialSubscribers(int subs)
          Register initial subscribers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Memory

protected Memory()
The Constructor.

Method Detail

addBindFeeEarnings

protected void addBindFeeEarnings(double earn)
Adds bind fee earnings.

Parameters:
earn - the earnings to add

addLostSubscriber

protected void addLostSubscriber()
Method to add a lost subscriber to the calculations


addNewSubscriber

protected void addNewSubscriber()
Adds a new subscriber


addSubscriptionEarnings

protected void addSubscriptionEarnings(double earn)
Adds subscription earnings.

Parameters:
earn - the earnings

calculateArpu

protected int calculateArpu()
                     throws NotEnoughDataException
Calculates the arpu for this round.

Returns:
the ARPU (Average Revenue Per User)
Throws:
NotEnoughDataException - if it is to early to calculate ARPU

calculateChurnRate

protected int calculateChurnRate()
                          throws NotEnoughDataException
Calculates the customer churn rate.

Returns:
the customer churn rate
Throws:
NotEnoughDataException - If it is too early to calculate customer churn

flushMemory

protected void flushMemory()
Flush memory from "short time"(periodic) to long time memory.


getLastSubscribers

protected int getLastSubscribers()
Gets the number of subscribers from last round

Returns:
the number of subscribers last round

getLostSubscribers

protected int getLostSubscribers()
Gets the lost subscribers this round

Returns:
the lost subscribers

getNewSubscribers

protected int getNewSubscribers()
Gets the new subscribers this round

Returns:
the new subscribers

getProfit

protected int getProfit()
Gets the total profit of this provider

Returns:
the profit

getRoundProfit

protected double getRoundProfit()
Gets the round profit.

Returns:
the round profit

getTotalSubscribers

protected int getTotalSubscribers()
Gets the total subscribers.

Returns:
the total subscribers

registerInitialSubscribers

protected void registerInitialSubscribers(int subs)
Register initial subscribers.

Parameters:
subs - the number of subscribers