|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectaa.core.CyberOrg
This class represents a cyberorg
Field Summary | |
long |
height
|
protected ActorName |
m_anFacilitator
|
protected boolean |
m_bIsActive
|
protected Contract |
m_conContract
|
protected CyberOrg |
m_cybParent
|
protected long |
m_lECash
|
protected java.util.LinkedList |
m_llActors
|
protected java.util.LinkedList |
m_llChildren
|
protected long |
m_lPrice
|
protected long |
m_lTicks
|
protected long |
m_lTicksRate
|
protected long |
m_lTimesliceAssigned
|
protected java.lang.Object[] |
m_objaAgs
|
protected Platform |
m_pPlatform
|
protected java.lang.String |
m_strFacilitatorClass
|
Constructor Summary | |
CyberOrg()
Creates a new instance of CyberOrg |
|
CyberOrg(Contract p_conContract,
java.lang.Long p_LECash,
java.util.LinkedList p_llActors)
Constructor that is used to create a cyberorg for the one which is migrating into the current cyberorg |
|
CyberOrg(java.lang.Long p_longTicks,
java.lang.Long p_longTicksRate,
java.lang.Long p_longECash,
java.lang.String p_strFacilitatorClass,
java.lang.Object[] p_objaAgs)
Creates a new instance of CyberOrg with known resource specification |
Method Summary | |
void |
addChild(CyberOrg p_cybChild)
Add a child cyberorg to the current child list |
CyberOrg |
assimilate()
CyberOrg assimilate |
long |
chargeTotalTicks()
This method is called by the scheduler after every sheduling cycle, in order to keep track of total resource inside this cyberorg if a cyberorg runs out of resource, it couldn't be scheduled until it gets resources from somewhere else |
void |
deleteActor(ActorName p_anActor)
Delete an Actor when it is distroyed |
void |
deleteChild(CyberOrg p_cybChild)
Delete a child cyberorg from the child list, it is called in assimilation |
CyberOrg |
findBestDestination()
This method is used to look for the best desitination cyberorg in migration |
java.util.LinkedList |
getActors()
Returns the actor list |
java.util.LinkedList |
getChildren()
Returns the child list of the current cyberorg |
Contract |
getContract()
Returns the contract |
long |
getECash()
Returns the number of eCash in the current cyberorg |
ActorName |
getFacilitator()
Returns the name of the facilitator actor |
long |
getHeight()
Returns the height of current cyberorg |
Platform |
getPlatform()
Returns to a handler of current platform |
long |
getPrice()
Returns the current resource price in the current cyberorg |
void |
getResBack(long p_lTicks,
long p_lTicksRate,
long p_lECash)
Get resource back from a child cyberorg which is assimilating called by assimilation of child cyberorg |
long |
getTicks()
Returns the amount of resources the current cyberorg has |
long |
getTicksRate()
Returns the resource rate of the current cyberorg |
void |
insertActor(ActorName p_anToInsert)
Insert an actor to the actors list |
CyberOrg |
isolate(long p_lECash,
ActorName[] p_anaActors,
Contract p_conContract)
CyberOrg isolate This method is called by the facilitator |
void |
migrate(ActorName p_anDestFacilitator,
Contract p_conNewContract)
CyberOrg migrate |
void |
printInfo()
toString for debug |
void |
receiveCyberOrg(Contract p_conContract,
java.lang.Long p_LECash,
java.util.LinkedList p_llActors)
Receive a CyberOrg This method is called when remote migration happens create a cyberorg according to the parameters we recived |
void |
receiveCyberOrg(Contract p_conContract,
java.lang.Long p_LECash,
java.util.LinkedList p_llActors,
CyberOrg p_cybMigrating)
Receive a CyberOrg without creating a new instance |
void |
resourceAlloc(ActorName p_anNeedResource)
Default resource allocation policy for actors in this cyberorg User can define their own resource allocation policy by overwriting this method |
void |
resourceAlloc(ActorName p_anNeedResource,
long p_lRate)
Another resource allocation policy which assigns a known amount of resource to the given actor |
void |
resourceAllocForAll()
Allocate resource for all actors It is called after migration (local) |
void |
setHeight(long p_lHeight)
Set up the height of current cyberorg |
void |
setNullChild()
it is called in remote migration. |
void |
setParent(CyberOrg p_cybParent)
Set parent cyberorg for this cyberorg it is called by isolation, migration |
void |
setPlatform()
Set up the current CyberOrgs platform |
void |
updateActors(ActorName p_anActorName)
Update Actors List, which is called in remote migration (when actors are migraing here) |
long |
updatePrice()
Oct 17th, 2005. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected long m_lTicks
protected long m_lTicksRate
protected long m_lECash
protected java.util.LinkedList m_llActors
protected transient java.util.LinkedList m_llChildren
protected transient CyberOrg m_cybParent
protected ActorName m_anFacilitator
protected Contract m_conContract
protected transient Platform m_pPlatform
protected java.lang.String m_strFacilitatorClass
protected java.lang.Object[] m_objaAgs
protected long m_lPrice
protected boolean m_bIsActive
protected long m_lTimesliceAssigned
public long height
Constructor Detail |
public CyberOrg()
public CyberOrg(java.lang.Long p_longTicks, java.lang.Long p_longTicksRate, java.lang.Long p_longECash, java.lang.String p_strFacilitatorClass, java.lang.Object[] p_objaAgs)
public CyberOrg(Contract p_conContract, java.lang.Long p_LECash, java.util.LinkedList p_llActors)
Method Detail |
public void setParent(CyberOrg p_cybParent)
p_cybParent
- The parent cyberorgpublic void setPlatform()
public void setNullChild()
public Platform getPlatform()
public void setHeight(long p_lHeight)
p_lHeight
- The height of current cyberorgpublic long getHeight()
public CyberOrg isolate(long p_lECash, ActorName[] p_anaActors, Contract p_conContract)
p_lECash
- The eCash that is given to the new child cyberorgp_anaActors
- A list of actors that will be isolated to the child cyberorgp_conContract
- The contract between the current cyberorg and its new child cyberorg
public void insertActor(ActorName p_anToInsert)
p_anToInsert
- The name of the actor which is added to the current actor listpublic void resourceAlloc(ActorName p_anNeedResource)
p_anNeedResource
- The name of the actor for which resources are allocatedpublic void resourceAlloc(ActorName p_anNeedResource, long p_lRate)
p_anNeedResource
- The name of the actor for which resources are allocatedp_lRate
- Amount of resource which is assigned to the given actorpublic void resourceAllocForAll()
public CyberOrg assimilate()
public void getResBack(long p_lTicks, long p_lTicksRate, long p_lECash)
p_lTicks
- Resources that are returned to the current cyberorgp_lTicksRate
- Resource rate that is returned to the current cyberorgp_lECash
- eCash that is returned to the current cyberorgpublic void deleteChild(CyberOrg p_cybChild)
p_cybChild
- The child cyberorg which is assimilatingpublic void addChild(CyberOrg p_cybChild)
p_cybChild
- The new child cyberorgpublic void deleteActor(ActorName p_anActor)
p_anActor
- The name of the actor to be deletedpublic void migrate(ActorName p_anDestFacilitator, Contract p_conNewContract)
p_anDestFacilitator
- The ficilitator actor of the destination parent cyberorgp_conNewContract
- The new contract between the current cyberorg and its new parentpublic ActorName getFacilitator()
public long getECash()
public java.util.LinkedList getActors()
public java.util.LinkedList getChildren()
public Contract getContract()
public long getTicks()
public long getTicksRate()
public long getPrice()
public void receiveCyberOrg(Contract p_conContract, java.lang.Long p_LECash, java.util.LinkedList p_llActors)
p_conContract
- The contract in the cyberorg that is being receivedp_LECash
- Number of eCashp_llActors
- Actor listpublic void receiveCyberOrg(Contract p_conContract, java.lang.Long p_LECash, java.util.LinkedList p_llActors, CyberOrg p_cybMigrating)
p_conContract
- Contract in the cyberorg being receivedp_LECash
- Number of eCashp_llActors
- Actor listp_cybMigrating
- A handler to the cyberorg in migrationpublic void updateActors(ActorName p_anActorName)
p_anActorName
- The name of the actor being added to the current cyberorgpublic void printInfo()
public long updatePrice()
public long chargeTotalTicks()
public CyberOrg findBestDestination()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |