Class Auction

java.lang.Object
  extended byAuction

public class Auction
extends java.lang.Object

Auction class provides methods to create entities, link them and finally to run the simulations. Auctions supported are First Price Sealed Bid, Second Price Sealed Bid, Double Auction PMD, and Double Auction TPD


Field Summary
static GMA[] allGMA
          To be used in future version
static Resource[] allResource
          Array of resources of size 10000, For simulations involving more than 10000 resources redefine array with bigger size
static User[] allUser
          Array of users of size 10000, For simulations involving more than 10000 users redefine array with bigger size
static int Auction_rounds
          Number of Auction rounds
static int Auction_Type
          To define Auction type Auction_Type = 0 First Price Sealed Bid Auction_Type = 1 Second Price Sealed Bid Auction_Type = 2 Double Auction PMD Auction_Type = 3 Continous Double Auction Auction_Type = 4 Double Auction TPD
static int BiddingPolicy
          To be used in future versions
static int count_groups
          reflects number of available groups
static int count_resources
          reflects number of available resources
static int count_users
          reflects number of active users
static int counter_rounds
          reflects present auction round
static double delay
          Used to assign Network Latency to entities
static GMAMonitor gmamonitor
          To be used in future version
static int[][] Groups
          Groups of resources with ID and Availability A group is available if atleast one resource belonging to it is free to serve tasks.
static double[][] GroupsAttr
          Attributes of groups such as number of resources belonging to it and Processing power of the group
static int Num_Of_GMAs
          To be used in future versions
static int Num_Of_Resources
          Defining Total number of Resources participating
static int Num_Of_Users
          Defining Total number of users participating in Auction
static double TotalWork
          Total Work of all users
 
Constructor Summary
Auction()
          Creates a new instance of Auction
 
Method Summary
static void addUser(java.lang.String Name, double totwork, double time, double money, int tasks, double percenthike)
          Creates a user with attributes as passed in parameters
static void addUser(java.lang.String Name, double totwork, double money, int tasks)
          Creates a user with attributes as passed in parameters
static void CreateGroup(int members, int ProcessingPower, double rate)
          Creates resources equal to members parameter and assigns attributes as specified by last 2 parameters
static void CreateGroup(int members, int ProcessingPower, double rate, double PercentDeclineInBid)
          Creates resources equal to members parameter and assigns attributes as specified by last 3 parameters
static int findGroup(int id)
          returns the position of a group if it's id is passed as parameter
static int groupcount()
          returns number of groups
static double GroupProcessingPower(int GroupNo)
          returns the processing power of a Group of resources when passed the position of group as parameter
static double groupsize(int groupNo)
          returns number of members of a Group of resources when passed the position of group as parameter
static void initialise(int AuctionType, int Resources, int Users, int Rounds, int BidPolicy, double del)
           
static void main(java.lang.String[] args)
          Not being used
static void MarkResourceDirtyInGroup(int resourceid)
          Marks a Group of resource as invalid if all the resources belonging to it are busy in serving tasks
static void MarkResourceValidInGroup(int resourceid)
          Marks a Group of resources as valid if atleast one resource belonging to it becomes free
static void RandomizeAllTasks()
          Randomly creates tasks out of total work of each user
static void start_simulation()
          Links all the entities through "in" and "out" ports of each entity.
static void totalwork()
          Calculates total work by adding work of individual users
static int ValidGroups()
          returns number of valid groups where each group have atleast resource free to serve tasks
static boolean ValidityOfGroup(int GroupNo)
          returns TRUE if atleast one resource is free in this group when ID of the group is passed as parameter, else FALSE
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Num_Of_Users

public static int Num_Of_Users
Defining Total number of users participating in Auction


Num_Of_GMAs

public static int Num_Of_GMAs
To be used in future versions


Auction_Type

public static int Auction_Type
To define Auction type Auction_Type = 0 First Price Sealed Bid Auction_Type = 1 Second Price Sealed Bid Auction_Type = 2 Double Auction PMD Auction_Type = 3 Continous Double Auction Auction_Type = 4 Double Auction TPD


count_resources

public static int count_resources
reflects number of available resources


count_users

public static int count_users
reflects number of active users


Auction_rounds

public static int Auction_rounds
Number of Auction rounds


counter_rounds

public static int counter_rounds
reflects present auction round


BiddingPolicy

public static int BiddingPolicy
To be used in future versions


Num_Of_Resources

public static int Num_Of_Resources
Defining Total number of Resources participating


allUser

public static User[] allUser
Array of users of size 10000, For simulations involving more than 10000 users redefine array with bigger size


allResource

public static Resource[] allResource
Array of resources of size 10000, For simulations involving more than 10000 resources redefine array with bigger size


allGMA

public static GMA[] allGMA
To be used in future version


gmamonitor

public static GMAMonitor gmamonitor
To be used in future version


TotalWork

public static double TotalWork
Total Work of all users


Groups

public static int[][] Groups
Groups of resources with ID and Availability A group is available if atleast one resource belonging to it is free to serve tasks.


GroupsAttr

public static double[][] GroupsAttr
Attributes of groups such as number of resources belonging to it and Processing power of the group


count_groups

public static int count_groups
reflects number of available groups


delay

public static double delay
Used to assign Network Latency to entities

Constructor Detail

Auction

public Auction()
Creates a new instance of Auction

Method Detail

start_simulation

public static void start_simulation()
Links all the entities through "in" and "out" ports of each entity. and finally runs the simulation


totalwork

public static void totalwork()
Calculates total work by adding work of individual users


CreateGroup

public static void CreateGroup(int members,
                               int ProcessingPower,
                               double rate)
Creates resources equal to members parameter and assigns attributes as specified by last 2 parameters


CreateGroup

public static void CreateGroup(int members,
                               int ProcessingPower,
                               double rate,
                               double PercentDeclineInBid)
Creates resources equal to members parameter and assigns attributes as specified by last 3 parameters


GroupProcessingPower

public static double GroupProcessingPower(int GroupNo)
returns the processing power of a Group of resources when passed the position of group as parameter


groupsize

public static double groupsize(int groupNo)
returns number of members of a Group of resources when passed the position of group as parameter


groupcount

public static int groupcount()
returns number of groups


findGroup

public static int findGroup(int id)
returns the position of a group if it's id is passed as parameter


ValidGroups

public static int ValidGroups()
returns number of valid groups where each group have atleast resource free to serve tasks


MarkResourceDirtyInGroup

public static void MarkResourceDirtyInGroup(int resourceid)
Marks a Group of resource as invalid if all the resources belonging to it are busy in serving tasks


MarkResourceValidInGroup

public static void MarkResourceValidInGroup(int resourceid)
Marks a Group of resources as valid if atleast one resource belonging to it becomes free


ValidityOfGroup

public static boolean ValidityOfGroup(int GroupNo)
returns TRUE if atleast one resource is free in this group when ID of the group is passed as parameter, else FALSE


initialise

public static void initialise(int AuctionType,
                              int Resources,
                              int Users,
                              int Rounds,
                              int BidPolicy,
                              double del)

addUser

public static void addUser(java.lang.String Name,
                           double totwork,
                           double time,
                           double money,
                           int tasks,
                           double percenthike)
Creates a user with attributes as passed in parameters


addUser

public static void addUser(java.lang.String Name,
                           double totwork,
                           double money,
                           int tasks)
Creates a user with attributes as passed in parameters


RandomizeAllTasks

public static void RandomizeAllTasks()
Randomly creates tasks out of total work of each user


main

public static void main(java.lang.String[] args)
Not being used