本文整理汇总了C#中AgentType类的典型用法代码示例。如果您正苦于以下问题:C# AgentType类的具体用法?C# AgentType怎么用?C# AgentType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AgentType类属于命名空间,在下文中一共展示了AgentType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ToTypeName
public static string ToTypeName(AgentType type)
{
string typeName = null;
switch (type)
{
case AgentType.SERVICE_BROKER:
typeName = ProcessAgentType.SERVICE_BROKER;
break;
case AgentType.BATCH_SERVICE_BROKER:
typeName = ProcessAgentType.BATCH_SERVICE_BROKER;
break;
case AgentType.REMOTE_SERVICE_BROKER:
typeName = ProcessAgentType.REMOTE_SERVICE_BROKER;
break;
case AgentType.LAB_SERVER:
typeName = ProcessAgentType.LAB_SERVER;
break;
case AgentType.BATCH_LAB_SERVER:
typeName = ProcessAgentType.BATCH_LAB_SERVER;
break;
case AgentType.EXPERIMENT_STORAGE_SERVER:
typeName = ProcessAgentType.EXPERIMENT_STORAGE_SERVER;
break;
case AgentType.SCHEDULING_SERVER:
typeName = ProcessAgentType.SCHEDULING_SERVER;
break;
case AgentType.LAB_SCHEDULING_SERVER:
typeName = ProcessAgentType.LAB_SCHEDULING_SERVER;
break;
default:
break;
}
return typeName;
}
示例2: SortDegreeFromAgentType
public int SortDegreeFromAgentType(AgentType agentType)
{
LSAgent agent = GetAgent ();
if (agent == null) return -1;
if (agentType == agent.MyAgentType) return 1;
return 0;
}
示例3: AgentCutaway
public AgentCutaway(AgentType agTy, Int32 ID, Coordinates pos_, AgentState state_)
{
type = agTy;
agentID = ID;
pos = pos_;
state = state_;
}
示例4: SetNpcTbl
public void SetNpcTbl(Npc_Tbl tbl, AgentType agType)
{
if (null == tbl)
{
Log.LogError("BlackBoard.SetNpcTbl : Npc_Tbl is null.");
return;
}
if (agType <= AgentType.None || agType >= AgentType.Max)
{
Log.LogError("BlackBoard.SetNpcTbl : AgentType is invaild.");
return;
}
npcTbl = tbl;
agentType = agType;
speed = tbl.speed;
health = tbl.hp;
skillDic.Clear();
if (agentType == AgentType.Monster
|| agentType == AgentType.Player)
{
for (int i = 0; i < npcTbl.skills.Length; i++)
{
int skillID = npcTbl.skills[i];
if (skillID != 0)
{
skillDic.Add(i, skillID);
SkillManager.Instance.AddSkill(guid, skillID);
}
}
}
}
示例5: SetProperty
public override void SetProperty(DesignerPropertyInfo property, object obj) {
base.SetProperty(property, obj);
_resetMethods = false;
DesignerMethodEnum enumAtt = property.Attribute as DesignerMethodEnum;
if (enumAtt != null && property.Property.PropertyType == null)
{ throw new Exception(string.Format(Resources.ExceptionDesignerAttributeExpectedEnum, property.Property.Name)); }
Nodes.Behavior behavior = GetBehavior();
_agentType = (behavior != null) ? behavior.AgentType : null;
SetTypes();
object action = property.Property.GetValue(obj, null);
MethodDef method = action as MethodDef;
int typeIndex = -1;
if (method != null) {
typeIndex = getTypeIndex(method.Owner);
}
if (typeIndex < 0) {
typeIndex = 0;
}
// Keep only one type for efficiency.
_currentNames.Clear();
_currentNames.Add(_names[typeIndex]);
this.typeComboBox.Items.Clear();
this.typeComboBox.Items.Add(_types[typeIndex]);
this.typeComboBox.SelectedIndex = 0;
}
示例6: AbstractImprov
public AbstractImprov(string name, string description, int scoreMultiplier, AgentType affectedType)
{
this.name = name;
this.description = description;
this.ScoreMultiplier = scoreMultiplier;
this.AffectedType = affectedType;
inUse = false;
}
示例7: Agent
public Agent(AgentType type)
{
Name = CreateName(type);
Type = type;
Energy = MaxEnergy / 2;
Age = 0;
Generation = 1;
Location = new Location(-1, -1);
Direction = Direction.West;
}
示例8: Agent
public Agent(AgentType agtType, string login, string lastname, string firstname, string extension, string description, CSQ[] csq)
{
_agenttype = agtType;
_loginid = login;
_lastname = lastname;
_firstname = firstname;
_extension = extension;
_description = description;
_csqs = csq;
}
示例9: Agent
public Agent(AgentModule module, AgentType type, int hp)
{
AgentModule = module;
AgentModule.Agent = this;
ActiveEmotions = new List<Emotion>();
ActiveEmotionPairs = new Dictionary<ActiveEmotionPair, float>();
AgentType = type;
HP = hp;
EmotionState = EmotionState.resilent;
}
示例10: AgentInfo
public AgentInfo(Color colour_, float radius_, AgentType agType_,
Int32 ID_, AgentState state_, float communicateRad_,
Coordinates coord_, float speed_, float viewRadius_)
{
agentID = ID_;
agentColor = colour_;
agentRadius = radius_;
agentType = agType_;
agentState = state_;
communicteRadius = communicateRad_;
coord = coord_;
speed = speed_;
viewRadius = viewRadius_;
}
示例11: SolveInstance
/// <summary>
/// This is the method that actually does the work.
/// </summary>
/// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
protected override void SolveInstance(IGH_DataAccess DA)
{
// First, we need to retrieve all data from the input parameters.
// We'll start by declaring variables and assigning them starting values.
AgentType agent = new AgentType();
// Then we need to access the input parameters individually.
// When data cannot be extracted from a parameter, we should abort this method.
if (!DA.GetData(0, ref agent)) return;
// We should now validate the data and warn the user if invalid data is supplied.
// We're set to create the output now. To keep the size of the SolveInstance() method small,
// The actual functionality will be in a different method:
// Finally assign the spiral to the output parameter.
DA.SetData(0, agent.Position);
DA.SetData(1, agent.Velocity);
DA.SetData(2, agent.Acceleration);
DA.SetData(3, agent.Lifespan);
}
示例12: EducateAgent
public static Agent EducateAgent(AgentType agentType)
{
var agent = new Agent(agentType);
var tmpInputs = agent.Inputs;
ArtificialBrain choosenBrain;
while (true)
{
var brain = CreateBrain();
SetBrain(agent, brain);
var scores = FitnessFunction(agent, StandardTests[agentType]);
if (scores >= 1700)
{
choosenBrain = brain;
break;
}
}
SetBrain(agent, choosenBrain);
agent.Inputs = tmpInputs;
return agent;
}
示例13: ResetMembers
public virtual bool ResetMembers(bool check, AgentType agentType, bool clear, MethodDef method = null, PropertyDef property = null) {
bool bReset = false;
foreach(Attachments.Attachment attach in this.Attachments) {
bReset |= attach.ResetMembers(check, agentType, clear, method, property);
}
foreach(Node child in this.GetChildNodes()) {
bReset |= child.ResetMembers(check, agentType, clear, method, property);
}
return bReset;
}
示例14: InitializeInputData
private void InitializeInputData(AgentType currType)
{
if (currType == AgentType.Household)
{
mobelWrkrsConditionals = new DiscreteCondDistribution();
mobelKidsConditionals = new DiscreteCondDistribution();
mobelPersConditionals = new DiscreteCondDistribution();
}
}
示例15: OpenCensusFiles
private void OpenCensusFiles(AgentType currType)
{
if (currType == AgentType.Household)
{
CensusPersonFileReader = new InputDataReader(
Constants.DATA_DIR + "\\Household\\CensusNumOfPers.csv");
CensusDwellFileReader = new InputDataReader(
Constants.DATA_DIR + "\\Household\\CensusDwellingType.csv");
CensusCarFileReader = new InputDataReader(
Constants.DATA_DIR + "\\Household\\CensusNumOfCars.csv");
CensusPersonFileReader.GetConditionalList();
CensusDwellFileReader.GetConditionalList();
CensusCarFileReader.GetConditionalList();
}
else if (currType == AgentType.Person)
{
CensusAgeFileReader = new InputDataReader(
Constants.DATA_DIR + "\\Person\\Person Z-Stats.csv");
CensusSexFileReader = new InputDataReader(
Constants.DATA_DIR + "\\Person\\Person Z-Stats.csv");
CensusHhldSizeFileReader = new InputDataReader(
Constants.DATA_DIR + "\\Person\\Person Z-Stats.csv");
CensusEduLevelFileReader = new InputDataReader(
Constants.DATA_DIR + "\\Person\\Person Z-Stats.csv");
CensusEduLevelFileReader.GetConditionalList();
}
}