edu.ntnu.ecosim.environment
Class ConsumerFactory

java.lang.Object
  extended by edu.ntnu.ecosim.environment.ConsumerFactory

public class ConsumerFactory
extends java.lang.Object

The consumer factory is "producing" the consumers, assuring that each consumer gets the necessary attributes and a unique ID. The consumer factory is also responsible for generating the social network.

Author:
Martin

Constructor Summary
protected ConsumerFactory(Market market)
          Constructor of the ConsumerFactory.
 
Method Summary
protected  void createSocialConnections()
          Method to generate the social networks between consumers.
protected  Consumer produceBoundConsumer(ServiceProvider spro)
          Method to produce a consumer subscribing to a specified service provider.
protected  Consumer produceSimpleConsumer()
          Method to produce a consumer which is not bound to any service provider.
protected  void resetCounter()
          Method to reset the counter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConsumerFactory

protected ConsumerFactory(Market market)
Constructor of the ConsumerFactory.

Parameters:
market - the market to produce consumers to
Method Detail

createSocialConnections

protected void createSocialConnections()
Method to generate the social networks between consumers.


produceBoundConsumer

protected Consumer produceBoundConsumer(ServiceProvider spro)
Method to produce a consumer subscribing to a specified service provider.

Parameters:
spro - the service provider
Returns:
the produced consumer

produceSimpleConsumer

protected Consumer produceSimpleConsumer()
Method to produce a consumer which is not bound to any service provider.

Returns:
the consumer

resetCounter

protected void resetCounter()
Method to reset the counter. Must be used when reinitializing the simulator