|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectResource
public class Resource
Resource class -- manages agents requesting a resource
| Constructor Summary | |
|---|---|
Resource()
Start out with no resource and an empty queue |
|
| Method Summary | |
|---|---|
void |
add(int production)
Add more produced resource. |
void |
addToList(DEAgent agent)
addToList -- add this agent to this resource's waiting list. |
int |
amountAvailable()
Method to get the amount available |
void |
consume(int amtDesired)
Consume resource |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Resource()
| Method Detail |
|---|
public int amountAvailable()
public void consume(int amtDesired)
amtDesired - the amount desiredpublic void add(int production)
production - the amount producedpublic void addToList(DEAgent agent)
agent - the agent to add as waiting
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||