本文整理汇总了C#中IZone类的典型用法代码示例。如果您正苦于以下问题:C# IZone类的具体用法?C# IZone怎么用?C# IZone使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IZone类属于命名空间,在下文中一共展示了IZone类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Team
public Team(IZone zone, JoinCondition join_condition)
{
_JoinCondidion = join_condition;
_Zone = zone;
_Handlers = new Utility.TUpdater<MemberHandler>();
}
示例2: Jet
/// <summary>
/// The constructor creates a Jet action for use by
/// an emitter. To add a Jet to all particles created by an emitter, use the
/// emitter's addAction method.
///
/// @see org.flintparticles.emitters.Emitter#addAction()
/// </summary>
/// <param name="accelerationX">The x coordinate of the acceleration to apply, in pixels
/// per second per second.</param>
/// <param name="accelerationY">The y coordinate of the acceleration to apply, in pixels
/// per second per second.</param>
/// <param name="zone">The zone in which to apply the acceleration.</param>
/// <param name="invertZone">If false (the default) the acceleration is applied only to particles inside
/// the zone. If true the acceleration is applied only to particles outside the zone.</param>
public Jet(double accelerationX, double accelerationY, IZone zone, bool invertZone)
{
m_x = accelerationX;
m_y = accelerationY;
m_zone = zone;
m_invert = invertZone;
}
示例3: ComputeUtility
public float ComputeUtility(IZone o, IZone d)
{
float sum = 0f;
var flatO = this.ZoneSystem.GetFlatIndex( o.ZoneNumber );
var flatD = this.ZoneSystem.GetFlatIndex( d.ZoneNumber );
bool any = false;
var zoneIndex = ( flatO * this.Zones.Length + flatD ) * this.Modes.Length;
for ( int mode = 0; mode < this.Modes.Length; mode++ )
{
EnsureResult( flatO, mode );
if ( this.Modes[mode].Feasible( o, d, this.SimulationTime ) )
{
var res = this.Modes[mode].CalculateV( o, d, this.SimulationTime );
if ( !float.IsNaN( res ) )
{
float v = (float)Math.Exp( res );
if ( this.Adjustments != null )
{
v *= this.Adjustments.GiveAdjustment( o, d, mode, (int)this.CurrentInteractiveCategory );
}
this.CurrentUtility[zoneIndex + mode] = v;
sum += v;
any = true;
}
}
}
return any ? (float)sum : float.NaN;
}
示例4: Adventure
public Adventure(Adventurer adventurer, Remoting.ISoulBinder binder, IZone zone)
{
_Adventurer = adventurer;
_Zone = zone;
this._Binder = binder;
_Squad = new Squad(adventurer.Formation ,_Adventurer.Teammates, _Adventurer.Controller);
}
示例5: ComputeAttraction
public float ComputeAttraction(float[] flatAttraction, IZone[] zones, int numberOfZones)
{
float totalAttractions = 0;
var demographics = this.Root.Demographics;
var flatEmploymentRates = demographics.JobOccupationRates.GetFlatData();
var flatJobTypes = demographics.JobTypeRates.GetFlatData();
for ( int i = 0; i < numberOfZones; i++ )
{
var total = 0f;
foreach ( var empRange in this.EmploymentStatusCategory )
{
for ( int emp = empRange.Start; emp <= empRange.Stop; emp++ )
{
foreach ( var occRange in this.EmploymentStatusCategory )
{
for ( int occ = occRange.Start; occ <= occRange.Stop; occ++ )
{
var temp = flatEmploymentRates[i][emp][occ];
temp *= flatJobTypes[i][emp];
temp *= zones[i].Employment;
total += temp;
}
}
}
}
totalAttractions += ( flatAttraction[i] = total );
}
return totalAttractions;
}
示例6: CreateRoom
/// <summary>
/// Creates an uninitialized, sealed room.
/// </summary>
/// <param name="name">The name of the room.</param>
/// <param name="owner">The zone that owns this room.</param>
/// <returns>Returns an uninitialized room instance</returns>
public Task<IRoom> CreateRoom(string name, IZone owner)
{
var room = new MudRoom(this.doorwayFactory, owner);
room.SealRoom();
return Task.FromResult((IRoom)room);
}
示例7: OnRequest
public void OnRequest( IDataObjectOutputStream outStream,
Query query,
IZone zone,
IMessageInfo info )
{
// To be a successful publisher of data using the ADK, follow these steps
// 1) Examine the query conditions. If they are too complex for your agent,
// throw the appropriate SIFException
// This example agent uses the autoFilter() capability of DataObjectOutputStream. Using
// this capability, any object can be written to the output stream and the stream will
// filter out any objects that don't meet the conditions of the Query. However, a more
// robust agent with large amounts of data would want to pre-filter the data when it does its
// initial database query.
outStream.Filter = query;
Console.WriteLine( "Responding to SIF_Request for StudentPersonal" );
// 2) Write any data to the output stream
foreach ( StudentPersonal sp in fData )
{
outStream.Write( sp );
}
}
示例8: GetSifResponses
public override ISifResponseIterator<StudentPersonal> GetSifResponses(Query query, IZone zone)
{
StudentPersonalIterator studentPersonalIterator = null;
if (query == null)
{
throw new ArgumentNullException("query");
}
if (query.HasConditions)
{
string key = ExtractPrimaryKey(query);
if (key == null)
{
throw new SifException(SifErrorCategoryCode.RequestResponse, SifErrorCodes.REQRSP_UNSUPPORTED_QUERY_9, "SIF Query not supported.", zone);
}
else
{
if (log.IsDebugEnabled) log.Debug("SIF Response requested for StudentPersonal with a SIF RefId of " + key + ".");
studentPersonalIterator = new StudentPersonalIterator(key);
}
}
else
{
if (log.IsDebugEnabled) log.Debug("SIF Response requested for all StudentPersonals.");
studentPersonalIterator = new StudentPersonalIterator(null);
}
return studentPersonalIterator;
}
示例9: AdkException
/// <summary> Constructs an exception with a detailed message that occurs in the
/// context of a zone
/// </summary>
/// <param name="msg">A message describing the exception
/// </param>
/// <param name="zone">The zone associated with the exception
/// </param>
public AdkException(string msg,
IZone zone)
: base(msg)
{
fZone = zone;
fZoneId = zone == null ? null : zone.ZoneId;
}
示例10: SifException
/// <summary> Constructs an exception to wrap one or more SIF_Errors received from an
/// inbound SIF_Ack message. This form of constructor is only called by
/// the Adk.
/// </summary>
public SifException( SIF_Ack ack,
IZone zone )
: base(null, zone)
{
fAck = ack;
fError = ack != null ? ack.SIF_Error : null;
}
示例11: CalculateV
public override float CalculateV(IZone origin, IZone destination, Time time)
{
if ( this.IsContained( origin, destination ) )
{
return this.Constant;
}
return 0f;
}
示例12: CalculateV
public override float CalculateV(IZone origin, IZone destination, XTMF.Time time)
{
if ( IsContained( origin, destination ) )
{
return this.Aivtt * this.NetworkData.TravelTime( origin, destination, time ).ToMinutes();
}
return 0;
}
示例13: Acces
protected Acces(string nom, IZone zoneFrom, IZone zoneTo)
{
this.Nom = nom;
ZoneFrom = zoneFrom;
ZoneTo = zoneTo;
zoneFrom.Access.Add(this);
zoneTo.Access.Add(this);
}
示例14: Other
public IZone Other(IZone zone)
{
if (ZoneFrom == zone)
return ZoneTo;
if (ZoneTo == zone)
return ZoneFrom;
return null;
}
示例15: MudRoom
/// <summary>
/// Initializes a new instance of the <see cref="MudRoom"/> class.
/// </summary>
/// <param name="doorFactory">The door factory used to create new doorway instances.</param>
public MudRoom(IDoorwayFactory doorFactory, IZone owner)
{
this.actors = new List<IActor>();
this.doorways = new List<IDoorway>();
this.doorFactory = doorFactory;
this.IsSealed = true;
this.Owner = owner;
}