I need this attached algorithm to be converted into MATLAB code. The auction game theory model chooses the best among the real time and non real time users in a two tier cognitive radio network.
the Proposed algorithm for auction game model.
Algorithm: Proposed auction game to be played among secondary users.
Input considerations
Set RT ={rs1 ,rs2,rs3,rs4,....rsn1} //Set of Real Time users to be served
Set NRT={ns1,ns2,ns3,ns4,.....nsn2} //Set of Non-Real Time users to be served
Set A ={a1,a2,a3,a4,..am}//Set of available channels formed using the local decision
//and employing cooperative sensing
Set π ={ NULL}, θ ={NULL} ,φ ={NULL} //Payoff, Price and Probability of detection vector
Set AlocRT[n1][m] =0 //Allocation matrix for real time user
Set AlocNRT[n2][m]=0 //Allocation matrix for non-real time user
//Algorithm phase 1 for Real Time users
RT_ALOC()
Step 1:Begin
Step 2:Repeat
Step 3: For each aj in A= {a1,a2,a3,a4,....am} do
Step 4: For each rsi in RT ={rs1,rs2,rs3,rs4....rsn1} do
Step 5: Retrieve Pdajrsi(Probability of detection) of rsi from bid and store it in φ
Step 6: Calculate Payoff pajrsi and price Oajrsi and store it in π and θ.
Step 7: done
Step 8: done
Step 9: Calculate Utility Function Ursi(TIER1)(pajrsi,Oajrsi) for each {aj,rsi} pair and
select a winner for each aj such that WINNER ajrsi= arg max rsi(Ursi(TIER 1)(pajrsi,Oajrsi)).
Step 10:Assign channel aj to user rsi and set AlocRT[i][j]=1
Step 11:RT=RT−{rsi}and A=A−{aj}
Step 12:Until RT={NULL } or A={NULL }
Step 13:Call NRT_ALOC(AlocRT[][])
Step 14:End Algorithm phase 2 for Non Real Time users
NRT_ALOC(AlocRT[][])
Step 1:Begin
Step 2:Repeat
Step 3:For each aj in A={a1,a2,a3,a4,...am}do
Step 4:For each nsk in NRT={ns1,ns2,ns3,ns4,...nsn2}do
For each i=1 to n1 do
Step 5:if AlocRT[i][j]==1 then
Step 6: tr1=Call User_TransmitTime(rsi)
Step 7: tr2=Call User_TransmitTime(nsk)
Step 8: γajnsk=Call GammaBinary(tr1,tr2)
Step 9: Store γajnsk in γ
Step 10: Retrieve Pdajnsk(Probability of detection) of nsk from bid and store it in φ
Step 11: Calculate Payoff pajnsk and price Oajnsk and store it in π and θ
Step 12: done
Step 13: done
Step 14: Calculate Utility Function Unsk(TIER2)(pajnsk,Oajnsk) for each {aj,nsk} pair and
select a winner for each aj such that WINNER ajnsk=argmaxnk(Unsk(TIER2)
(pajnsk,Oajnsk)).
Step 15: Assign channel aj to user nsk and set AlocNRT[k][j]=1
Step 16: NRT=NRT−{nsk} and A=A−{aj}
Step 17: Until NRT={NULL} or A={NULL}
Step 18: For j=1 to m do
Step 19: For i=1 to n1 do
Step 20: For k=1 to n2 do
Step 21: If AlocRT[i][j]==1&& AlocNRT[k][j]==1 then
Step 22: Call startTransmission(rsi,nsk,aj)
Step 23: End If
Step 24:done
Step 25:done
Step 26:done
Step 27:End
This algorithm is taken from the paper "Optimized secondary user selection for quality of
service enhancement of Two-Tier multi-user Cognitive Radio Network: A game theoretic approach"
The link to this paper is given below.
https://www.sciencedirect.com/science/article/pii/S1389128617301949
Optimized secondary user selection for quality of service enhancement of Two-Tier multi-user Cognitive Radio Network: A game theoretic approach
What I have tried:
Already tried writing code in matlab . Utility function is not returning its values.