public class HolonObject extends AbstractCpsObject
Constructor and Description |
---|
HolonObject(AbstractCpsObject obj)
Contructor of a copy of an Object.
|
HolonObject(java.lang.String objName)
Constructor Set by default the name of the object equals to the category
name, until the user changes it.
|
Modifier and Type | Method and Description |
---|---|
void |
addElements(HolonElement element)
adds an Element to the Object.
|
boolean |
checkIfPartiallySupplied(int x)
Check if Partially Supplied.
|
java.util.ArrayList<HolonElement> |
copyElements(java.util.ArrayList<HolonElement> arr)
Copy all Elements into a New Array.
|
void |
deleteElement(int idx)
deletes Element at a given index.
|
java.awt.Color |
getColor()
Get the Color.
|
float |
getCurrentEnergy()
Doesn't take into account which timestep is watched, calculates the max
values.
|
float |
getCurrentEnergyAtTimeStep(int x)
Getter for the current energy at a given timestep.
|
java.util.HashMap<java.lang.String,java.lang.Integer> |
getEleIdx()
Getter index of all elements in the HolonObject.
|
java.util.ArrayList<HolonElement> |
getElements()
Getter for all Elements in the HolonObject.
|
int |
getState()
Get the state of the Object.
|
HolonElement |
searchElement(java.lang.String name)
Search for the element with the name.
|
HolonElement |
searchElementById(int id)
Search for the element with the id.
|
void |
setColor(java.awt.Color color)
Set the State Color.
|
void |
setEleIdx(java.util.HashMap<java.lang.String,java.lang.Integer> eleIdx)
Set the indexes of all elements.
|
void |
setElements(java.util.ArrayList<HolonElement> elements)
Set a new ArrayList with HolonElements into the HolonObject.
|
void |
setState()
sets the State, wether object is a producer, zero Energy, supplied or
not.
|
void |
setState(int state)
Set the state of the Object.
|
java.lang.String |
toStringElements()
String of all consumers in this HolonObject.
|
addConnection, addPseudoTag, addTag, getBorderColor, getConnectedTo, getConnections, getID, getImage, getName, getObjName, getPosition, getPseudoTags, getSav, getTag, resetTags, setBorderColor, setConnections, setID, setImage, setName, setObjName, setPosition, setPosition, setPseudoTags, setSav, setTags
public HolonObject(java.lang.String objName)
objName
- name of the Objectpublic HolonObject(AbstractCpsObject obj)
obj
- object to be copiedpublic void setState()
public java.util.ArrayList<HolonElement> getElements()
public void setElements(java.util.ArrayList<HolonElement> elements)
elements
- the elements to setpublic void addElements(HolonElement element)
element
- the Element to addpublic float getCurrentEnergy()
public float getCurrentEnergyAtTimeStep(int x)
x
- timesteppublic void deleteElement(int idx)
idx
- indexpublic java.lang.String toStringElements()
public java.util.HashMap<java.lang.String,java.lang.Integer> getEleIdx()
public void setEleIdx(java.util.HashMap<java.lang.String,java.lang.Integer> eleIdx)
eleIdx
- the eleIdx to setpublic java.util.ArrayList<HolonElement> copyElements(java.util.ArrayList<HolonElement> arr)
arr
- to copypublic int getState()
public void setState(int state)
state
- boolean if the Object is fully suppliedpublic HolonElement searchElement(java.lang.String name)
name
- name of the object to be searchedpublic HolonElement searchElementById(int id)
id
- id of the element to be foundedpublic boolean checkIfPartiallySupplied(int x)
x
- current Iterationpublic void setColor(java.awt.Color color)
color
- the Colorpublic java.awt.Color getColor()