edu.ntnu.ecosim.agents.serviceproviders
Class ServiceProvider

java.lang.Object
  extended by edu.ntnu.ecosim.agents.Agent
      extended by edu.ntnu.ecosim.agents.serviceproviders.ServiceProvider

public class ServiceProvider
extends Agent

This is the class representing the service provider agent.

Author:
Martin

Field Summary
 
Fields inherited from class edu.ntnu.ecosim.agents.Agent
market
 
Constructor Summary
ServiceProvider(java.lang.String name, int initsub, double subFee, double bindFee, Market market, java.lang.String strat, int innostr, int innotype, int ecofl)
          The constructor of service providers
 
Method Summary
 void addInnovation(Innovation i)
          Adds an innovation to the providers list of innovations
 void addSubscriber()
          Adds a subscriber to the total number of subscribers.
 double calculateArpu()
          Method to calculate the ARPU of the provider
 double calculateChurnRate()
          Calculates the customer churn rate of the provider for this round
protected  int getAvgSubsCostInMarket()
          Method used to compare this providers costs to the average subscription costs in the market.
 double getBindingFee()
          Method used to get the binding fee of the provider
 Innovation getInnovation(int place)
          Method to get an innovation from this providers list of innovations
 java.lang.String getName()
          Gets the name of the provider
 int getNewSubscribers()
          Gets the number of new subscribers.
protected  int getNofConsumersInMaret()
          Gets the number of consumers in the market
 int getNofInnovations()
          Gets the number of innovations by this service provider
 int getNofSubscribers()
          Gets the number of subscribers.
 int getProfit()
          Gets the total profit of this provider.
 double getRoundProfit()
          Gets the profit for this round
 double getSubscriptionFee()
          Gets the subscription fee of this provider
 java.lang.String getUniqueID()
          Gets the unique ID of the provider.
 void performAction()
          This is the method that is called for each new time step.
 void removeSubscriber()
          Removes one subscriber from the total number of subscribers this service provider has.
protected  void setBindingFee(double bf)
          Sets the binding fee for this provider
 void setSubscriptionFee(double sf)
          Sets the subscription fee for the provider
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceProvider

public ServiceProvider(java.lang.String name,
                       int initsub,
                       double subFee,
                       double bindFee,
                       Market market,
                       java.lang.String strat,
                       int innostr,
                       int innotype,
                       int ecofl)
                throws NoSuchStrategyException
The constructor of service providers

Parameters:
name - The name of the provider
initsub - The number of initial subscribers for this service provider
subFee - The subscription fee
bindFee - The binding fee
market - The market the provider operates within
strat - The strategy of the provider
innostr - The innovation strategy of the provider
innotype - The innovation type of the provider
ecofl - The economic flexibility that the provider has
Throws:
NoSuchStrategyException - if the strategy is not recognized
Method Detail

addInnovation

public void addInnovation(Innovation i)
Adds an innovation to the providers list of innovations

Parameters:
i - the innovation

addSubscriber

public void addSubscriber()
Adds a subscriber to the total number of subscribers.


calculateArpu

public double calculateArpu()
Method to calculate the ARPU of the provider

Returns:
the ARPU

calculateChurnRate

public double calculateChurnRate()
Calculates the customer churn rate of the provider for this round

Returns:
the churn rate

getAvgSubsCostInMarket

protected int getAvgSubsCostInMarket()
Method used to compare this providers costs to the average subscription costs in the market. The method calculates the average susbscription costs.

Returns:
the avg. subscription costs

getBindingFee

public double getBindingFee()
Method used to get the binding fee of the provider

Returns:
the bindingFee

getInnovation

public Innovation getInnovation(int place)
Method to get an innovation from this providers list of innovations

Parameters:
place - the place in the list the innovation is located at
Returns:
the innovation

getName

public java.lang.String getName()
Gets the name of the provider

Returns:
the name

getNewSubscribers

public int getNewSubscribers()
Gets the number of new subscribers.

Returns:
the number of new subscribers

getNofConsumersInMaret

protected int getNofConsumersInMaret()
Gets the number of consumers in the market

Returns:
the number of consumers

getNofInnovations

public int getNofInnovations()
Gets the number of innovations by this service provider

Returns:
the number of innovations

getNofSubscribers

public int getNofSubscribers()
Gets the number of subscribers.

Returns:
the number of subscribers

getProfit

public int getProfit()
Gets the total profit of this provider.

Returns:
the profit

getRoundProfit

public double getRoundProfit()
Gets the profit for this round

Returns:
the profit

getSubscriptionFee

public double getSubscriptionFee()
Gets the subscription fee of this provider

Returns:
the subscriptionFee

getUniqueID

public java.lang.String getUniqueID()
Gets the unique ID of the provider.

Returns:
the unique ID

performAction

public void performAction()
Description copied from class: Agent
This is the method that is called for each new time step. The method contains the basic operations that an agent performs for each time step.

Specified by:
performAction in class Agent

removeSubscriber

public void removeSubscriber()
Removes one subscriber from the total number of subscribers this service provider has. Used when a subscriber changes to another provider.


setBindingFee

protected void setBindingFee(double bf)
Sets the binding fee for this provider

Parameters:
bf - the new binding fee of the service provider

setSubscriptionFee

public void setSubscriptionFee(double sf)
Sets the subscription fee for the provider

Parameters:
sf - the new subscription fee