flowsim.slatr
Class UserImpl

java.lang.Object
  |
  +--flowsim.slatr.UserImpl
Direct Known Subclasses:
FTPUser, SLATUser, UserVoice

public abstract class UserImpl
extends java.lang.Object
implements flowsim.slatr.User, Service

Generic/common User implementation.


Field Summary
protected  long budget
           
protected  long budget_incr
           
protected  float max_utility
           
protected  Node node
           
protected  int port
           
protected  Simulator s
           
protected  float utility
           
 
Constructor Summary
UserImpl(Simulator s, Node node, int port, long budget, long budget_incr)
           
 
Method Summary
 void add_to_budget(long money)
           
 long get_budget_incr()
          returns by how much the budget is increased per second.
 long get_budget()
           
 float get_max_utility()
           
 Node get_node()
           
 int get_port()
           
 float get_utility()
           
 void print_stats()
           
 void remove_from_budget(long money)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

s

protected final Simulator s

node

protected final Node node

port

protected final int port

budget

protected long budget

budget_incr

protected long budget_incr

max_utility

protected float max_utility

utility

protected float utility
Constructor Detail

UserImpl

public UserImpl(Simulator s,
                Node node,
                int port,
                long budget,
                long budget_incr)
Parameters:
s - simulator object.
node - node where the user resides.
port - port where the user resides.
budget - initial budget.
budget_incr - budget increase pro second.
See Also:
User
Method Detail

get_node

public Node get_node()
Specified by:
get_node in interface Service

get_port

public int get_port()
Specified by:
get_port in interface Service

get_budget

public long get_budget()
Specified by:
get_budget in interface flowsim.slatr.User

get_budget_incr

public long get_budget_incr()
returns by how much the budget is increased per second.
Specified by:
get_budget_incr in interface flowsim.slatr.User

get_max_utility

public final float get_max_utility()
Specified by:
get_max_utility in interface flowsim.slatr.User

get_utility

public final float get_utility()
Specified by:
get_utility in interface flowsim.slatr.User

add_to_budget

public void add_to_budget(long money)
Specified by:
add_to_budget in interface flowsim.slatr.User

remove_from_budget

public void remove_from_budget(long money)
Specified by:
remove_from_budget in interface flowsim.slatr.User

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

print_stats

public void print_stats()
Specified by:
print_stats in interface flowsim.slatr.User