Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
javadsaberlatibari authored Apr 1, 2024
1 parent 8903d1e commit bb34a98
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions wellcoordination/benchmark/rubis.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Rubis : public ReplicatedObject
//openAuction 1(id) by default consider 100 auctions are open.
//placeBid 3 3(auctionid+userid+value)
//openauctions 4
//closeauction
//closeauctions
//query 6 like movie does not consider read.
private:

Expand Down Expand Up @@ -123,7 +123,7 @@ class Rubis : public ReplicatedObject
// 3
void placeBid(int a_id, int u_id, int value)
{
if(registeredusers.count(u_id)==1 && openauctions.count(a_id)==1 && closeauction.count(a_id)==0){
if(registeredusers.count(u_id)==1 && openauctions.count(a_id)==1 && closeauctions.count(a_id)==0){
if(auction[a_id][1]<value){
auction[a_id][0]=u_id;
auction[a_id][1]=value;
Expand All @@ -133,15 +133,15 @@ class Rubis : public ReplicatedObject

void openAction(int a_id, int stock)
{
if(openauctions.count(a_id)==0 && closeauction.count(a_id)==0){
if(openauctions.count(a_id)==0 && closeauctions.count(a_id)==0){
auction[a_id][0]=stock;
openauctions.insert(a_id);
}
}
void closeActions(int a_id)
{
if(openauctions.count(a_id)==1 && closeauction.count(a_id)==0){
closeauction.insert(a_id);
if(openauctions.count(a_id)==1 && closeauctions.count(a_id)==0){
closeauctions.insert(a_id);
}
}

Expand Down

0 comments on commit bb34a98

Please sign in to comment.