public class Resource extends java.lang.Object implements Basic
Constructor and Description |
---|
Resource(Model model,
java.lang.String id,
java.lang.String resourceType,
int resourceTotal)
Constructor, a Resource contains a List and a ProcessNew instance.
|
Modifier and Type | Method and Description |
---|---|
Grafic |
createGrafic(java.lang.String viewId,
int x,
int y,
java.lang.String defaultEntityTypeId,
int anzVisible,
boolean horizontal,
java.awt.Dimension deltaSize)
create a ProcessGrafic
|
Grafic |
getGrafic()
get ProcessGrafic, created before
|
java.lang.String |
getId()
get id of resource
|
Model |
getModel() |
java.lang.String |
getName()
get name of resource
|
int |
getProcessEntriesAnz()
actual no. of entities (sets with process-entities) in process-part
|
java.lang.String |
getProcessEntry(int index)
get id of entity in position index in process
|
int |
getResourceEntriesAnz(int index)
get actual no. of resources, used by entity in position index
|
int |
getResourceFree()
actual no of free resources
|
int |
getResourceTotal()
total no. of available resources
|
java.lang.String |
getResourceType()
get resource Type (only for information)
|
int |
getResourceUsed()
no of actual used resources
|
java.lang.String[][] |
getWaitingQueueContent()
get content of waiting queue
|
void |
provide(java.lang.String processEntityId,
int priority,
int resourceEntityAnz,
java.lang.String priorityAttribute,
long time)
put a processEntity, that require resourceEntityAnz resources, into
waiting queue
|
void |
setName(java.lang.String name)
set name of resource
|
void |
takeBack(java.lang.String processEntityId,
int resourceGiveBackAnz,
long time)
removes processEntity from process
|
void |
takeProcess(java.lang.String processEntityId,
long time)
move processEntity from waiting queue to process
|
public Resource(Model model, java.lang.String id, java.lang.String resourceType, int resourceTotal)
model
- used animation.model.Modelid
- resourceIdresourceType
- resourceTypeName (only for information, its no Id)resourceTotal
- total number of resources (only for information)public java.lang.String getId()
getId
in interface ClassBasic
public void setName(java.lang.String name)
name
- public java.lang.String getName()
public java.lang.String getResourceType()
public int getResourceTotal()
public int getResourceUsed()
public int getResourceFree()
public int getProcessEntriesAnz()
public java.lang.String getProcessEntry(int index) throws ModelException
index
- ModelException,
- when a internal error occurredModelException
public int getResourceEntriesAnz(int index)
index
- public java.lang.String[][] getWaitingQueueContent()
public void provide(java.lang.String processEntityId, int priority, int resourceEntityAnz, java.lang.String priorityAttribute, long time) throws ModelException
processEntityId
- id of processEntityresourceEntityAnz
- required no. of resourcestime
- simulation timeModelException,
- when processEntity isn't freeModelException
public void takeProcess(java.lang.String processEntityId, long time) throws ModelException
processEntityId
- id of processEntitytime
- simulation timeModelException,
- when entity isn't in waiting queueModelException
public void takeBack(java.lang.String processEntityId, int resourceGiveBackAnz, long time) throws ModelException
processEntityId
- id of processEntitytime
- simulation timeModelException,
- when entity isn't in processModelException
public Grafic createGrafic(java.lang.String viewId, int x, int y, java.lang.String defaultEntityTypeId, int anzVisible, boolean horizontal, java.awt.Dimension deltaSize) throws ModelException
viewId
- Id of viewx
- middlepoint x-coordinatey
- middlepoint y-coordinatedefaultEntityTypeId
- for sizingModelException