|
|||||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectorg.boxed_economy.besp.model.fmfw.FmFwObject
org.boxed_economy.besp.model.fmfw.Behavior
エージェントの行なう様々な行動をBehaviorとして定義します。 behaviorは状態機械によって実現されます。そして、様々なEventを受け取ります。 ただし、behaviorはmodelによってアルゴリズムが大きく異なる部分があるため、 アブストラクトとして提供します。実際モデルに使われるBehaviorはこのクラスを継承して作成してください。 フレームワークとして、開始・終了・イベント受信・Channel設定のためのインターフェースを提供します。 また、Channelを現在のChannelおよび、複数持つことができます。
入れ子クラスの概要 |
クラス org.boxed_economy.besp.model.fmfw.FmFwObject から継承した入れ子クラス |
FmFwObject.InstanceCounter |
コンストラクタの概要 | |
Behavior()
|
メソッドの概要 | |
void |
firePrepareTimeEventReceive(UpdateBehaviorEvent e)
for event |
void |
fireStateChanged(UpdateBehaviorEvent e)
|
void |
fireTimeEventReceived(UpdateBehaviorEvent e)
|
void |
fireTransitionStarted(UpdateBehaviorEvent e)
|
Channel |
getActiveChannel()
Behavior自身が開いているChannelを返します |
Agent |
getAgent()
Behaviorを持つAgentを返します。 |
java.util.List |
getAllChannels()
すべての経路を取得します |
Goods |
getReceivedGoods()
|
Information |
getReceivedInformation()
情報だけを受け取るための便利メソッド |
abstract State |
getState()
現在の状態を取得します. |
BehaviorType |
getType()
Method getType. |
World |
getWorld()
このBehaviorが所属しているAgentが配置されているWorldを返します。 |
protected abstract boolean |
isReceivableEvent(Event e)
RelationからChannelの開設に関して許可を求めるメソッドです。 |
void |
keepReceivedGoods()
財関連 受け取った財を保管しておくしくみ |
boolean |
receivedGoodsEquals(GoodsType type)
受け取った財が引数で与えられたGoodsTypeと同じかどうか調べる。 |
boolean |
receivedInformationEquals(InformationType type)
受け取った財に付随する情報が引数で与えられたInformationTypeと同じかどうか調べる。 |
protected abstract void |
receiveEvent(Event e)
Channelや、Agentから送られたEventを受け取るメソッドです。 |
protected abstract void |
run()
状態機械を開始するためのメソッドです。 |
void |
sendGoods(Goods goods)
財を送信します 既に開かれているChannelを利用します 開かれているChannelがない場合、Exceptionを投げます |
protected void |
sendGoods(Relation relation,
BehaviorType behaviorType,
Goods goods)
財を送信します 関係を指定します(自動的にkeep=falseなChannelを開きます) |
void |
sendGoods(Relation relation,
BehaviorType behaviorType,
Goods goods,
boolean keep)
財を送信します 関係を指定します(自動的にChannelを開きます) |
protected int |
sendGoods(RelationType relationType,
BehaviorType behaviorType,
GoodsType goodsType,
double goodsQuantity,
boolean createGoods)
財を送信します |
protected int |
sendGoods(RelationType relationType,
BehaviorType behaviorType,
GoodsType goodsType,
double goodsQuantity,
boolean createGoods,
boolean keep)
財を送信します |
void |
sendInformation(Information information)
情報を送信します。 |
void |
sendInformation(InformationType key,
Information information)
タイプを指定して,情報を送信します。 |
void |
sendInformation(Relation relation,
BehaviorType behaviorType,
Information information)
情報を送信します。 |
void |
sendInformation(Relation relation,
BehaviorType behaviorType,
Information information,
boolean keep)
情報を送信します。 |
int |
sendInformation(RelationType relationType,
BehaviorType behaviorType,
Information information)
情報を送信します。 |
int |
sendInformation(RelationType relationType,
BehaviorType behaviorType,
Information information,
boolean keep)
情報を送信します。 |
int |
sendInformation(RelationType relationType,
BehaviorType behaviorType,
InformationType key,
Information information,
boolean keep)
タイプを指定して,情報を送信します。 |
void |
setReceivedGoods(ChannelEvent event)
|
void |
setType(BehaviorType type)
Method setType. |
protected abstract void |
stop()
状態機械を停止するためのメソッドです。 |
クラス org.boxed_economy.besp.model.fmfw.FmFwObject から継承したメソッド |
finalize, getInstanceCounters |
クラス java.lang.Object から継承したメソッド |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
コンストラクタの詳細 |
public Behavior()
メソッドの詳細 |
public BehaviorType getType()
public final void setType(BehaviorType type)
type
- public World getWorld()
public Agent getAgent()
public abstract State getState()
public Channel getActiveChannel()
public java.util.List getAllChannels()
protected abstract void run()
protected abstract void stop()
protected abstract boolean isReceivableEvent(Event e)
e
- 開設を求めるChannelの情報を含むEvent
protected abstract void receiveEvent(Event e)
e
- 送られたイベントhypublic final void sendGoods(Goods goods)
public final void sendGoods(Relation relation, BehaviorType behaviorType, Goods goods, boolean keep)
protected final void sendGoods(Relation relation, BehaviorType behaviorType, Goods goods)
public final void sendInformation(Information information)
public final void sendInformation(Relation relation, BehaviorType behaviorType, Information information, boolean keep)
public final void sendInformation(Relation relation, BehaviorType behaviorType, Information information)
public final int sendInformation(RelationType relationType, BehaviorType behaviorType, Information information)
public final int sendInformation(RelationType relationType, BehaviorType behaviorType, Information information, boolean keep)
public final void sendInformation(InformationType key, Information information)
public final int sendInformation(RelationType relationType, BehaviorType behaviorType, InformationType key, Information information, boolean keep)
protected final int sendGoods(RelationType relationType, BehaviorType behaviorType, GoodsType goodsType, double goodsQuantity, boolean createGoods)
protected final int sendGoods(RelationType relationType, BehaviorType behaviorType, GoodsType goodsType, double goodsQuantity, boolean createGoods, boolean keep)
public void keepReceivedGoods()
public void setReceivedGoods(ChannelEvent event)
public Goods getReceivedGoods()
public Information getReceivedInformation()
public boolean receivedInformationEquals(InformationType type)
public boolean receivedGoodsEquals(GoodsType type)
public void firePrepareTimeEventReceive(UpdateBehaviorEvent e)
public void fireTimeEventReceived(UpdateBehaviorEvent e)
public void fireStateChanged(UpdateBehaviorEvent e)
public void fireTransitionStarted(UpdateBehaviorEvent e)
|
|||||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |