flowsim.slatr
Class SLATUser

java.lang.Object
  |
  +--flowsim.slatr.UserImpl
        |
        +--flowsim.slatr.SLATUser
Direct Known Subclasses:
SLATUserVoice

public abstract class SLATUser
extends UserImpl
implements SLABuyer

User of services provided by a SLATRouter.

See Also:
SLATRouter

Field Summary
protected  SLASeller server
           
 
Fields inherited from class flowsim.slatr.UserImpl
budget, budget_incr, max_utility, node, port, s, utility
 
Constructor Summary
SLATUser(Simulator s, Node node, int port, long budget, long budget_incr, int server_port)
           
 
Method Summary
protected  void ask(SLA ideal)
           
 void bid_received(SLA bid)
           
abstract  float bid_utility(SLA ideal, SLA bid)
          definition: bid_utility(ideal,ideal)=1, bid_utility(ideal,nothing)=0
protected  boolean buy_best_bid(SLA ideal)
           
protected  void buy(SLA ideal)
           
 void confirm_received(SLA sla)
           
 SLABuyerProfile get_profile()
           
 void print_stats()
           
 void receive_bid(SLATP_Bid msg)
           
 void receive_confirm(SLATP_Confirm msg)
           
 void receive_reject(SLATP_Reject msg)
           
 void remove_bid(SLA bid)
           
 void remove_sla(SLA sla)
           
protected  void send_ask(Node dest, int bw, int max_delay, long expiration)
           
 java.lang.String toString()
           
abstract  int utility_wtp(SLA sla)
          willingness to pay for maximal utility
 
Methods inherited from class flowsim.slatr.UserImpl
add_to_budget, get_budget_incr, get_budget, get_max_utility, get_node, get_port, get_utility, remove_from_budget
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

server

protected SLASeller server
Constructor Detail

SLATUser

public SLATUser(Simulator s,
                Node node,
                int port,
                long budget,
                long budget_incr,
                int server_port)
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.
server_port - port of (unique) SLASeller for this user.
Method Detail

get_profile

public SLABuyerProfile get_profile()
Specified by:
get_profile in interface SLABuyer

remove_sla

public void remove_sla(SLA sla)

remove_bid

public void remove_bid(SLA bid)

bid_received

public void bid_received(SLA bid)

receive_bid

public final void receive_bid(SLATP_Bid msg)
Specified by:
receive_bid in interface SLABuyer

confirm_received

public void confirm_received(SLA sla)

receive_confirm

public final void receive_confirm(SLATP_Confirm msg)
Specified by:
receive_confirm in interface SLABuyer

receive_reject

public final void receive_reject(SLATP_Reject msg)
Specified by:
receive_reject in interface SLABuyer

bid_utility

public abstract float bid_utility(SLA ideal,
                                  SLA bid)
definition: bid_utility(ideal,ideal)=1, bid_utility(ideal,nothing)=0

utility_wtp

public abstract int utility_wtp(SLA sla)
willingness to pay for maximal utility

send_ask

protected void send_ask(Node dest,
                        int bw,
                        int max_delay,
                        long expiration)

ask

protected void ask(SLA ideal)

buy

protected void buy(SLA ideal)

buy_best_bid

protected boolean buy_best_bid(SLA ideal)

toString

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

print_stats

public void print_stats()
Overrides:
print_stats in class UserImpl