B.A.R.G.A.M.E. v2.0 El Farol Bar Problem Implementation

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Defines
Public Member Functions
Bar Class Reference

Bar Class. More...

List of all members.

## Public Member Functions
| Bar ()
| Default Bar Constructor.
| Bar (int cap)
| Bar Constructor.
int | getBarCapacity ()
| returns a bars "Maxcapacity"
double | wonThisTurn (int peeps)
| Bar Class.

## Detailed Description

Bar Class.

This is the Bar class which contains the Bar object constructor which creates one instance of a bar characteristized by its unqiue maxcapacity "maxcapacity" to be available to the simulated population to choice as well as two additional functions: getBarCapacity() wonThisTurn(int peeps) which are used within the Town class. Detailed descriptions of the functions given below.

## Constructor & Destructor Documentation

Bar::Bar | ( |  | ) |

Default Bar Constructor.

Default constructor NOT utilized within code.

Bar::Bar | ( | int | cap | ) |

Bar Constructor.

Description: Bar Constructor which initializes a bars only attribute, its capacity to the sepecifed value. This is extracted from the what the user inputs into the GUI.

Parameters:

  cap | The value to which the Bars Object attribute "Maxcapacity" is defined as.

Precondition:
  A Town has been initialized.

Postcondition:
  The variable "Maxcapacity" is defined for a given bar.

## Member Function Documentation

int Bar::getBarCapacity | ( |  | ) |

returns a bars "Maxcapacity"

Description: Returns an integer which represents a bars "Maxcapacity".

Precondition:
  Attribute "Maxcapacity" is defined.

Postcondition:
  None.

double Bar::wonThisTurn | ( | int | peeps | ) |

Bar Class.

Description: Using division, we divide the number of people going to this bar by the bars attribute "Maxcapacity" in order return a number that shows what the bars capacity ratio is for a specific round.

Parameters:

  peeps | The number of Agents who have decided to visit the given Bar Object.

Precondition:
  The number of Agents going to this specific bar has been decided.

Postcondition:
  The outcome of this bar(bar has won/lost) has been decided.

The documentation for this class was generated from the following file:

- Doxygen Specific Source Code/Bar.h