de.cesr.more.basic.agent
Class MAgentNetworkComp<A,E extends MoreEdge<? super A>>

java.lang.Object
  extended by de.cesr.more.basic.agent.MAgentNetworkComp<A,E>
Type Parameters:
A - the common type (of agents) that is contained as nodes in the networks
All Implemented Interfaces:
MoreAgentNetworkComp<A,E>
Direct Known Subclasses:
MAgentAnalyseNetworkComp

public class MAgentNetworkComp<A,E extends MoreEdge<? super A>>
extends Object
implements MoreAgentNetworkComp<A,E>

TODO check if networks of different type are required! TODO make sure not more than one network with same name inserted

Date:
19.01.2010

Field Summary
protected  A agent
           
protected  MoreNetwork<A,E> mainNetwork
           
protected  Map<String,MoreNetwork<A,E>> networks
           
 
Constructor Summary
MAgentNetworkComp(A agent)
           
 
Method Summary
 MoreNetwork<A,E> getMainNetwork()
           
 MoreNetwork<A,E> getNetwork(String name)
           
 Collection<MoreNetwork<A,E>> getNetworks()
          Getter of the property networks
 void setMainNetwork(MoreNetwork<A,E> network)
           
 void setNetwork(MoreNetwork<A,E> network)
          Registers the given network by the given network's name (network.getName()).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

agent

protected A agent

mainNetwork

protected MoreNetwork<A,E extends MoreEdge<? super A>> mainNetwork

networks

protected Map<String,MoreNetwork<A,E extends MoreEdge<? super A>>> networks
Constructor Detail

MAgentNetworkComp

public MAgentNetworkComp(A agent)
Parameters:
agent -
Method Detail

getNetworks

public Collection<MoreNetwork<A,E>> getNetworks()
Getter of the property networks

Specified by:
getNetworks in interface MoreAgentNetworkComp<A,E extends MoreEdge<? super A>>
Returns:
Returns the networks.

setNetwork

public void setNetwork(MoreNetwork<A,E> network)
Description copied from interface: MoreAgentNetworkComp
Registers the given network by the given network's name (network.getName()). If it is the first network registered the given network also becomes main network.

Specified by:
setNetwork in interface MoreAgentNetworkComp<A,E extends MoreEdge<? super A>>
See Also:
de.cesr.more.basic.agent.MoreAgentNetworkComp#setNetwork(de.cesr.lara.components.LaraNetwork)

getNetwork

public MoreNetwork<A,E> getNetwork(String name)
Specified by:
getNetwork in interface MoreAgentNetworkComp<A,E extends MoreEdge<? super A>>
Returns:
the network with the given name
See Also:
MoreAgentNetworkComp.getNetwork(java.lang.String)

setMainNetwork

public void setMainNetwork(MoreNetwork<A,E> network)
Specified by:
setMainNetwork in interface MoreAgentNetworkComp<A,E extends MoreEdge<? super A>>
See Also:
MoreAgentNetworkComp.setMainNetwork(de.cesr.more.basic.network.MoreNetwork)

getMainNetwork

public MoreNetwork<A,E> getMainNetwork()
Specified by:
getMainNetwork in interface MoreAgentNetworkComp<A,E extends MoreEdge<? super A>>
Returns:
the agent's main social network
See Also:
MoreAgentNetworkComp.getMainNetwork()