|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--SimObs.Resource
Used to represent simulation objects that need not be represented as individual entities since they are identical and can be taken and returned by objects that are represented as entities. A major theme of most discrete simulations is resource contention, in which two or more entities require the same resource. In effect, a resource is a pool of identical items.
Constructor Summary | |
Resource()
Alternative constructor for an empty resource pool. |
|
Resource(java.lang.String thisName,
int total)
Simple constructor that give the resource a name and sets up the initial amount in the pool. |
Method Summary | |
void |
add(int more)
Adds extra resource units to this resource pool. |
void |
commit(int thisAmount)
Commits thisAmount from the freeAmount available in this resource pool. |
int |
getAmount()
Returns with the total amount in this resource pool. |
int |
getFreeAmount()
Returns with the no of units currently unused in this resource pool. |
void |
makeAvail(int thisAmount)
Release thisAmount of resource, thus increasing freeAmount by thisAmount. |
void |
setAmount(int thisAmount)
Sets the amount in this resource. |
void |
setFreeAmount(int thisAmount)
Sets the freeAmount in this resource. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public Resource(java.lang.String thisName, int total)
public Resource()
Method Detail |
public void add(int more)
public int getFreeAmount()
public void setFreeAmount(int thisAmount)
public int getAmount()
public void setAmount(int thisAmount)
public void commit(int thisAmount)
public void makeAvail(int thisAmount)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |