org.boxed_economy.besp.model.fmfw
クラス Relation

java.lang.Object
  拡張org.boxed_economy.besp.model.fmfw.FmFwObject
      拡張org.boxed_economy.besp.model.fmfw.Relation
すべての実装インタフェース:
java.io.Serializable

public final class Relation
extends FmFwObject

Boxed Economyにおけるagent間の静的な関連性を定義します。 この種類はRelationTypeによって定義されます。 goodsを送るために動的なChannelを生成することができます。 (生成されたChannelはRelationに保持されます。) relationは方向を持ち、relationStartとrelationEndのagentを保持します。

バージョン:
$Id: Relation.java,v 1.1 2004/03/21 12:07:47 macchan Exp $
作成者:
macchan
関連項目:
直列化された形式

入れ子クラスの概要
 
クラス org.boxed_economy.besp.model.fmfw.FmFwObject から継承した入れ子クラス
FmFwObject.InstanceCounter
 
コンストラクタの概要
protected Relation(RelationType type, Agent source, Agent target)
          コンストラクタです。
 
メソッドの概要
protected  void fireChanneClosed(UpdateRelationEvent e)
           
protected  void fireChanneOpened(UpdateRelationEvent e)
           
 Agent getSource()
          このrelationを持っているagentを返します。
 Agent getTarget()
          このrelationが指しているagentを返します。
 RelationType getType()
          このRelationのTypeを返します。
 boolean openChannel(Behavior openBehavior, BehaviorType targetBehaviorType)
          Channelを開設するためのメソッドです。
 boolean openChannel(Behavior openBehavior, BehaviorType targetBehaviorType, boolean keepChannel)
          Channelを開設するためのメソッドです。
protected  void removeChannel(Channel channel)
          Channelを閉じます。
 
クラス org.boxed_economy.besp.model.fmfw.FmFwObject から継承したメソッド
finalize, getInstanceCounters
 
クラス java.lang.Object から継承したメソッド
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

Relation

protected Relation(RelationType type,
                   Agent source,
                   Agent target)
コンストラクタです。

パラメータ:
type - RelationのType
source - 関係元Agent
target - 関係先Agent
メソッドの詳細

getType

public RelationType getType()
このRelationのTypeを返します。

戻り値:
RelationType

getSource

public Agent getSource()
このrelationを持っているagentを返します。

戻り値:
relationStart Relation元のAgent

getTarget

public Agent getTarget()
このrelationが指しているagentを返します。

戻り値:
relationEnd Relation先のAgent

openChannel

public boolean openChannel(Behavior openBehavior,
                           BehaviorType targetBehaviorType)
Channelを開設するためのメソッドです。引数に開設するBehaviorと、Channelを結ぶ 対象であるBehaviorのTypeを与えることで、Channelを開設する処理を行います。 このメソッドによって開設されたChannelはBehaviorに保存されません。

パラメータ:
openBehavior - Channelを開設するBehavior
戻り値:
boolean 開設できたかの真偽

openChannel

public boolean openChannel(Behavior openBehavior,
                           BehaviorType targetBehaviorType,
                           boolean keepChannel)
Channelを開設するためのメソッドです。引数に開設するBehaviorと、Channelを結ぶ 対象であるBehaviorのTypeを与えることで、Channelを開設する処理を行います。

パラメータ:
openBehavior - Channelを開設するBehavior
keepChannel - 開設されたChannelを保存するかの真偽
戻り値:
boolean 開設できたかの真偽

removeChannel

protected void removeChannel(Channel channel)
Channelを閉じます。Channelから呼ばれます。

パラメータ:
channel - 閉じるChannel

fireChanneOpened

protected void fireChanneOpened(UpdateRelationEvent e)

fireChanneClosed

protected void fireChanneClosed(UpdateRelationEvent e)