![]() | ||||||
#include <Alloc-CC.h>
Inheritance diagram for CharnesCooper:


CharnesCooper:
Implements the Charnes-Cooper allocation algorithm. The allocation is stored in a matrix (Array2D). More details in the file header.
Author : Michael Eldridge
Definition at line 81 of file Alloc-CC.h.
Public Member Functions | |
| CharnesCooper (const int p_no_resources, const int p_no_areas, const Array2D &p_effectiveness, const valarray< double > p_available, const valarray< double > p_POC) | |
| Constructor calls calcAllocation and uses Array2D to store allocation. | |
Protected Member Functions | |
| void | calcAllocation () |
| Calculate the allocation using the Charnes Cooper algorithm. | |
| ActiveArea * | firstArea (void) const |
| Returns the area number of the first area in this allocation. | |
| ActiveArea * | nextArea (const int currentArea) const |
| Given an area number, returns the next area that has something assigned to it. | |
| AreaAssignment * | firstArea (const int Resource) const |
| Returns the area number of the first area in this allocation. | |
| AreaAssignment * | nextArea (const int Resource, const int currentArea) const |
| Given a resource and an area number, returns the next area to which this resource is assigned. | |
| ResourceAssignment * | firstRes (const int Area) const |
| Given an area, it returns the first resource assigned to that area. | |
| ResourceAssignment * | nextRes (const int Area, const int currentResource) const |
| Given a resource and an area, it returns the next ResourceAssignment for that area. | |
| double | calcInitialPSR (const int resourceNum, const int areaNum) |
| Calculates the initial Probable Success Rate used in CC. | |
Private Member Functions | |
| CharnesCooper (const CharnesCooper &p_allocation) | |
| CharnesCooper & | operator= (const CharnesCooper &p_allocation) |
| void | quickSort (int items[], int arraySize) |
| Top level of quickSort algorithm. The recursive part is in qSort. | |
| void | qSort (int items[], int left, int right) |
| Recursive part of quickSort algorithm. | |
Private Attributes | |
| Array2D | myAssignments |
| The set of assignments, stored as a dynamically allocated matrix. | |
| double | myAvailable |
| The amount of our resource still available. | |
Friends | |
| class | AreaIterator |
| So that the AreaIterator can access the first & next functions. | |
| class | ResourceIterator |
| So that the ResourceIterator can access the first & next functions. | |
| class | ActiveAreasIterator |
| So that the ActiveAreasIterator can access the first & next functions. | |
|
||||||||||||||||||||||||
|
Constructor calls calcAllocation and uses Array2D to store allocation. Constructor for the Charnes Cooper allocation object. (File description and header file description have more information about the algorithm.) Author : Michael Eldridge Definition at line 79 of file Alloc-CC.cpp. References calcAllocation(). |
|
|
Calculate the allocation using the Charnes Cooper algorithm. calcAllocationCharnesCooper() Note: Charnes Cooper only uses 1 resource Uses the Charnes-Cooper algorithm to calculate the optimal assignment of resource 0 to the set of areas. The remaining search endurance (time the resource is still available for) is stored in myAvailable. This set of assignments is stored in myAssignments. If resource 0 is useless (for every area, either POC is zero, or its effectiveness in that area is zero), no allocation is made (resource 0 is assigned to each area for 0 hours). Author: Gareth Thompson Implements Allocation. Definition at line 385 of file Alloc-CC.cpp. References calcInitialPSR(), myAssignments, myAvailable, Allocation::myEffectiveness, Allocation::myNumAreas, and quickSort(). Referenced by CharnesCooper(). |
|
||||||||||||
|
Calculates the initial Probable Success Rate used in CC. Calculates the initial PSR (Probable Success Rate) upon which the Charnes-Cooper algorithm is based. If W = sweep width (this resource, in this area) v = velocity (this resource, in this area) A = area size (m^2 or km^2 or whatever units v is in) p = POC or POA (this area) Effectiveness = Wv/A, so: PSR = Wvp/A = Wv * (p/A) = Wv * Pden where Pden is the probability density of the area. So PSR is the rate at which probability is swept up. For one resource, if you search highest-PSR areas first, you win. Maximal change in probability per time. Definition at line 129 of file Alloc-CC.h. References Allocation::myEffectiveness, and Allocation::myPOC. Referenced by calcAllocation(), and qSort(). |
|
|
Returns the area number of the first area in this allocation. Returns the first AreaAssignment (an area and a time) that a given resource was assigned to. If the resource does not exist in this allocation, it returns NULL.
Implements Allocation. Definition at line 141 of file Alloc-CC.cpp. References myAssignments, and Allocation::myNumAreas. |
|
|
Returns the area number of the first area in this allocation. Returns the area number of the first area in this allocation. If the allocation is empty, returns NULL.
Implements Allocation. Definition at line 107 of file Alloc-CC.cpp. References myAssignments, Allocation::myNumAreas, and Allocation::myNumResources. |
|
|
Given an area, it returns the first resource assigned to that area. Given an area, it returns the first resource assigned to that area (returned as a ResourceAssignment with the resource and time). If there are no resources, it returns NULL
Implements Allocation. Definition at line 247 of file Alloc-CC.cpp. References myAssignments, and Allocation::myNumResources. |
|
||||||||||||
|
Given a resource and an area number, returns the next area to which this resource is assigned. Given a resource and an area number, returns the next area (returned as an AreaAssignment of area and time) to which _this_ resource is assigned. If this resource is not assigned to any more areas, the function returns NULL.
Implements Allocation. Definition at line 213 of file Alloc-CC.cpp. References myAssignments, and Allocation::myNumAreas. |
|
|
Given an area number, returns the next area that has something assigned to it. Given an area number, returns the next area that has something assigned to it in this set of allocations. If there is no other area with an allocation of resources greater than 0, the function returns NULL. NOTE: This function searches by AREA: ie it searches through all of area N and all resources before searching through area N+1 and all resources. Etc.
Implements Allocation. Definition at line 175 of file Alloc-CC.cpp. References myAssignments, Allocation::myNumAreas, and Allocation::myNumResources. |
|
||||||||||||
|
Given a resource and an area, it returns the next ResourceAssignment for that area. Given a resource and an area, it returns the next resource assigned to that area (as a ResourceAssignment). If there are no next resources, it returns NULL.
Implements Allocation. Definition at line 282 of file Alloc-CC.cpp. References myAssignments, and Allocation::myNumResources. |
|
||||||||||||
|
Top level of quickSort algorithm. The recursive part is in qSort. Sorts a list of ints (which are the index numbers of a set of areas) into decending order by their area's PSR values. Reminder: Quicksort is on average O(n log n), but in the worst case will be O(n^2). The worst case is when the list is already sorted. So... DO NOT use this function additional times just to "ensure" the list is ordered. Definition at line 315 of file Alloc-CC.cpp. References qSort(). Referenced by calcAllocation(). |
| (SARBayes) | Main | Related Pages | Class List | Hierarchy | Methods | Files |
|---|