Algorithm:
The algorithm initializes the price of each good to be unit, computes the worth of the initial endowment of each agent, and gives this money to each agent. All goods are initially fully unsold.
We will denote by p=(p1,p2,...,pn) the vector of prices of goods at any point in the algorithm. As p changes, the algorithm recomputes the value of each agent’s initial endowment and updates her money accordingly. Clearly, at the start of the algorithm, the total surplus (unspent) money of all agents is n.
At any point in the algorithm, a part of good j is sold at price pj and part of it is sold at (1+€)pj. The run of the algorithm is partitioned into iterations. Each iteration terminates when the price of some good is raised by a factor of (1+€). Each iteration is further partitioned into rounds. In a round, the algorithm considers agents one by one in some arbitrary but fixed order, say 1,2,...,m. If the agent being considered, i, has no surplus money, the algorithm moves to the next agent. Otherwise, it finds i’s optimal good, in terms of bang per buck, at current prices; say, it is good j. It then proceeds to execute the operation of outbid. This entails buying back good j from agents who have it at price pj and selling it to i at price pj(1+€). This process can end in one of two ways:
Agent i’s surplus money is exhausted. If so, the algorithm moves on to the next agent.
No agent has good j at price pj anymore. If so, it raises the price of good j to pj(1+€) by setting pj to pj(1+€). The current iteration terminates and agents’ moneys are updated because of this price rise.
When the current round comes to an end, the algorithm checks if the total surplus money with the buyers is at most €a min. If so, the algorithm terminates. Otherwise, it goes to the next round.
At termination, the algorithm gives the unsold goods to an arbitrary agent to ensure that the market clears. It outputs the allocations received by all agents and the terminating prices p. Observe, however, that some of good j may have been sold at price (1+€) pj even though the equilibrium price of good j is pj. Because of this descrepancy, agents will only get approximately optimal bundles.
Process Model:
The process model has three states:
Initialization state [init]
Idle state [wait]
Checking request state [chec_rqst_typ]
Initialization state [init]:
This is a forced state. This state initializes the process. Executes the enter executives as under
total_bw = 1024; //total bandwidth that can be allocated
bw_req_value =0; //initialize req value to zero
self_ID = op_id_self ();
op_ima_obj_attr_get (self_ID,"bw_variable", &bw_variable); //obtain attributes of the packets.
Idle state [wait]:
This is an unforced state. When the command comes to this state, it waits for an interrupt [PKT_ARRIVAL]. When the interrupt [PKT_ARRIVAL] comes it sends the command to the next state [ pkt_rqst_typ ], otherwise it waits.
Checking request state [chec_rqst_typ]:
This is a forced state. Command is send to this state if the interrupt [PKT_ARRIVAL] comes. It executes the following enter executives,
pkt_pointer = op_pk_get(0);
op_pk_nfd_get (pkt_pointer, "bw_req", &bw_req_value);
request_array[i] = bw_req_value;
++i;
if (i==49)
{
op_sim_end("","","","") ;
}
This assigns the packet pointer and obtain desired packet attributes, assigns the attributes to the request array and if the requests exceeds the total bandwidth then end the simulation.
Then it executes the following exit executives,
total_bw=total_bw-bw_req_value; //allocate bandwidth
send_pkt = op_pk_create_fmt("out_pkt");
op_pk_nfd_set (send_pkt, "pk_nmbr",i );
op_pk_send (send_pkt, OUT_STRM);
This assigns bandwidth as requested and send the packet through OUT_STRM, and send the command back to the idle state.
Node Model:
The node model has the following components
Packet generator
Processor [Auction Algorithm]
Transmitter
Receiver
Packet generator:
Packet generator generate packets of the type ” bw_req_packet”.
The following enter executives are executed as the process runs
new_pkt = op_pk_create_fmt("bw_req_packet");
op_pk_nfd_set (new_pkt, "bw_req",4 );
op_pk_send (new_pkt,0);
It creates a packet formate "bw_req_packet" and sets the "bw_req" field to the desired value as this will request for the bandwidth when the packet is received by the receiver.
Packet format:
The packet format has the following 4 fields
Source address
Destination address
Cyclic redundancy check
Bandwidth request value
Processor [Auction Algorithm]:
The initializing state:
This is a forced state and it execute the following enter executives
total_bw = 1024; //total bandwidth that can be allocated
bw_req_value =0; //initialize req value to zero
self_ID = op_id_self ();
op_ima_obj_attr_get (self_ID,"bw_variable", &bw_variable);
It initializes the total bandwidth variable, and sets the bandwidth request value to 0. Then it sends command to the idle state.
Idle state:
This is an unforced state and it waits for an interrupt of the type PKT_ARRIVAL then it sends the command to the next state.
Checking request state [chk_rqst_typ]:
This is a forced state. This process model is stated in the start. This assigns the packet pointer and obtain desired packet attributes, assigns the attributes to the request array and if the requests exceeds the total bandwidth then end the simulation.
Then it assigns bandwidth as requested and send the packet through OUT_STRM, and send the command back to the idle state.
Transmitter:
It sends the packet which is requested to send through OUT_STRM.
Receiver:
It receives packets form the IN_STRM and forward it to the next process.
Node interfaces:
The following are the node statistics
Project:
The first run of the project was empty scenarios.
No comments:
Post a Comment