|
|||||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectorg.boxed_economy.besp.model.fmfw.FmFwObject
org.boxed_economy.besp.model.fmfw.Entity
org.boxed_economy.besp.model.fmfw.Agent
BoxedEconomyにおけるエージェントとなるクラスです。worldに配置されます。 --以下のオブジェクトを所有し、Managerクラスを通して管理します。 Goods,Behavior,Relation,Information また、TimeEventを受け取ってBehaviorを駆動します。 Agentは継承することを前提にはしていません。
入れ子クラスの概要 |
クラス org.boxed_economy.besp.model.fmfw.FmFwObject から継承した入れ子クラス |
FmFwObject.InstanceCounter |
コンストラクタの概要 | |
protected |
Agent(AgentType type)
Agentを生成するコンストラクタです。 |
メソッドの概要 | |
void |
addBehavior(BehaviorType type)
Behaviorを追加します。 |
void |
addGoods(Goods goods)
財を追加します。 |
void |
addRelation(Agent target)
デフォルトのTypeを利用してRelationを追加します。 |
void |
addRelation(RelationType relationType,
Agent target)
Relationを追加します。 |
void |
destroy()
このAgentが死亡(あるいは倒産)する時に呼ばれるメソッドです。 |
protected void |
fireBehaviorAdded(UpdateAgentEvent e)
|
protected void |
fireBehaviorRemoved(UpdateAgentEvent e)
|
protected void |
fireGoodsAdded(UpdateAgentEvent e)
|
protected void |
fireGoodsRemoved(UpdateAgentEvent e)
|
protected void |
fireInformationAdded(UpdateAgentEvent e)
|
protected void |
fireInformationRemoved(UpdateAgentEvent e)
|
protected void |
fireRelationAdded(UpdateAgentEvent e)
|
protected void |
fireRelationRemoved(UpdateAgentEvent e)
|
java.util.List |
getAllBehaviors()
Returns All Behaviors. |
java.util.List |
getAllRelations()
Returns All Relations. |
Behavior |
getBehavior(BehaviorType type)
引数のTypeであるBehaviorを返します。 |
java.util.Collection |
getBehaviors(BehaviorType type)
引数のTypeであるBehaviorをCollectionとして全て返します。 |
java.util.Collection |
getBehaviorsRecursively(BehaviorType type)
引数のType及びその子タイプであるBehaviorをCollectionとして全て返します。 |
java.util.Collection |
getGoodsTypes()
このAgentが持つ全ての財の種類を返します |
Information |
getInformation(Information key)
引数のInformationをキーとするInformation(cloneではありません)を返します キーが見つからなかった場合、Exceptionを返します。 |
GoodsQuantity |
getQuantity(GoodsType type)
指定された種類の財の量を取得します。 |
GoodsQuantity |
getQuantityRecursively(GoodsType type)
指定された種類の財の量を取得します。 |
Relation |
getRelation(RelationType type)
引数のTypeであるRelationを返します。 |
Relation |
getRelation(RelationType type,
Agent agent)
引数のType、かつ関係先が引数のAgentであるRelationを返します |
java.util.Collection |
getRelations(RelationType type)
引数のTypeであるrelationをCollectionとして全て返します。 |
java.util.Collection |
getRelationsRecursively(RelationType type)
引数のType及びそのTypeの子のTypeである全てのrelationを返します。 |
java.util.Collection |
getRelationTypes()
このAgentの持つRelationのTypeを返します。 |
AgentType |
getType()
AgentTypeを取得します. |
boolean |
hasGoods(GoodsType type)
指定された種類の財を持っているかどうか調べます |
void |
initialize()
agentの持つgoodsManager、informationManager、relationManager、behaviorManager をinitalizeします。 |
void |
putInformation(Information key,
Information value)
Informationを追加します。 |
void |
receiveDeathEvent(Agent target)
他のAgentが死亡(あるいは倒産)したときに、そのAgentとの関係を削除するために 呼ばれるメソッドです。 |
Behavior |
receiveOpenChannelEvent(OpenChannelEvent e)
Channelを開設するためにChannelOpenEventを受け取るメソッドです。 |
void |
receiveTimeEvent(TimeEvent e)
TimeEventを受け取ってbehaviorManagerに送ります。 |
Goods |
removeAllGoods(GoodsType type)
指定された種類の財をすべて引き出します。 |
java.util.Collection |
removeAllGoodsRecursively(GoodsType type)
指定された種類の財をすべて引き出します。 |
void |
removeBehavior(Behavior behavior)
Behaviorを終了して削除します。 |
Goods |
removeGoods(GoodsType type,
double quantity)
指定された種類の財を指定量引き出します。 |
java.util.Collection |
removeGoodsRecursively(GoodsType type,
double quantity)
指定された種類の財を指定量引き出します。 |
Information |
removeInformation(Information key)
引数のInformationをキーとするInformationを削除します。 |
void |
removeRelation(Relation relation)
引数のRelationを削除します。 |
void |
removeRelations(RelationType type)
引数のTypeのRelation全てを削除します。 |
void |
removeRelationsRecursively(RelationType type)
引数のType及びその子TypeのRelation全てを削除します。 |
クラス org.boxed_economy.besp.model.fmfw.Entity から継承したメソッド |
getInformation, getInformations, getWorld, hasInformation, putInformation, setInformations, setWorld |
クラス org.boxed_economy.besp.model.fmfw.FmFwObject から継承したメソッド |
finalize, getInstanceCounters |
クラス java.lang.Object から継承したメソッド |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
コンストラクタの詳細 |
protected Agent(AgentType type)
type
- 生成時に指定するAgentTypeメソッドの詳細 |
public void initialize()
public AgentType getType()
public void destroy()
public void receiveTimeEvent(TimeEvent e)
e
- TimeEventpublic void receiveDeathEvent(Agent target)
target
- 死亡(あるいは倒産、消滅)したAgentpublic void putInformation(Information key, Information value)
Entity
内の putInformation
key
- キーのInformationvalue
- 値のInformationpublic Information getInformation(Information key)
Entity
内の getInformation
key
-
public Information removeInformation(Information key)
Entity
内の removeInformation
key
- 検索キー
public void addBehavior(BehaviorType type)
public void removeBehavior(Behavior behavior)
public Behavior getBehavior(BehaviorType type)
type
- 検索対象のType
public java.util.Collection getBehaviors(BehaviorType type)
type
- 検索対象のType
public java.util.Collection getBehaviorsRecursively(BehaviorType type)
type
- 検索対象のType
public java.util.List getAllBehaviors()
public Behavior receiveOpenChannelEvent(OpenChannelEvent e)
e
- Channel開設に必要なChannelOpenEventpublic void addGoods(Goods goods)
goods
- 追加する財public Goods removeGoods(GoodsType type, double quantity)
type
- 引き出す財の種類quantity
- 引き出す財の量
public java.util.Collection removeGoodsRecursively(GoodsType type, double quantity)
type
- 引き出す財の種類quantity
- 引き出す財の量
public Goods removeAllGoods(GoodsType type)
type
- 引き出す財の種類
public java.util.Collection removeAllGoodsRecursively(GoodsType type)
type
- 引き出す財の種類
public GoodsQuantity getQuantity(GoodsType type)
type
- 調べる財の種類
public GoodsQuantity getQuantityRecursively(GoodsType type)
type
- 調べる財の種類
public boolean hasGoods(GoodsType type)
public java.util.Collection getGoodsTypes()
public void addRelation(Agent target)
public void addRelation(RelationType relationType, Agent target)
public void removeRelation(Relation relation)
relation
- 削除対象のRelationpublic void removeRelations(RelationType type)
type
- 削除対象のTypepublic void removeRelationsRecursively(RelationType type)
type
- 削除対象のTypepublic java.util.Collection getRelationTypes()
public Relation getRelation(RelationType type)
type
- 検索対象のType
public java.util.Collection getRelations(RelationType type)
type
- 検索対象のType
public java.util.List getAllRelations()
public java.util.Collection getRelationsRecursively(RelationType type)
type
- 検索対象のType
public Relation getRelation(RelationType type, Agent agent)
protected void fireGoodsAdded(UpdateAgentEvent e)
protected void fireGoodsRemoved(UpdateAgentEvent e)
protected void fireInformationAdded(UpdateAgentEvent e)
protected void fireInformationRemoved(UpdateAgentEvent e)
protected void fireRelationAdded(UpdateAgentEvent e)
protected void fireRelationRemoved(UpdateAgentEvent e)
protected void fireBehaviorAdded(UpdateAgentEvent e)
protected void fireBehaviorRemoved(UpdateAgentEvent e)
|
|||||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |