public People(string name, int age, EmotionalState attitude, FavoriteColor color) { _name = name; _age = age; _attitude = attitude; _color = color; }
/// <summary> /// Default constructor. /// </summary> public Person() { _placeBets = true; _currentBet = 0; _currentwinnings = 0; _emotionalState = EmotionalState.Mutual; }
public void Feel(Tutor tutor) { string moodString = getEmotionName(tutor.Emotion); EmotionalState emotionalState = getStateType <EmotionalState>(moodString); avatarManager.Feel(tutor.Name, emotionalState, tutor.Emotion.Intensity); }
public Monster(string name, int age, EmotionalState attitude, Tribe tribe) { _name = name; _age = age; _attitude = attitude; _tribe = tribe; }
public void Express(Tutor tutor) { string expressionString = getEmotionName(tutor.Emotion); EmotionalState expressionState = getStateType <EmotionalState>(expressionString); avatarManager.Express(tutor.Name, expressionState, tutor.Emotion.Intensity); }
public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { base.OnStateEnter(animator, stateInfo, layerIndex); activationParamHash = Animator.StringToHash(activationParameterName); enjoymentParamHash = Animator.StringToHash(enjoymentParameterName); emotionalState = animator.GetComponentInParent <EmotionalState>(); }
public Monster(string name, int age, EmotionalState attitude, TribeName tribe, bool active) { _name = name; _age = age; _attitude = attitude; _tribe = tribe; _active = active; }
/// <summary> /// Adds to DB emotional state /// </summary> /// <param name="emotionalState"></param> public void AddEmotionalState(EmotionalState emotionalState) { using (PsychoCareContext db = _contextBuilder.GetContext()) { db.EmotionalStates.Add(emotionalState); db.SaveChanges(); } }
private void Emotional_State_Should_Be_In_Db() { using (var db = new TestPsychoCareContext()) { EmotionalState emotionalState = db.EmotionalStates.SingleOrDefault(x => x.UserId == 3); emotionalState.Should().NotBeNull(); } }
public void UpdateEmotionalState() { stateValues[(int)EmotionalState.attention] = attentionVal; stateValues[(int)EmotionalState.stress] = stressVal; stateValues[(int)EmotionalState.relax] = relaxVal; stateValues[(int)EmotionalState.meditation] = meditationVal; stateValues[(int)EmotionalState.neutralState] = 0f; EmotionalState previousState = currentState; for (int i = 0; i < (int)EmotionalState.numEntries; i++) { if (stateValues[i] > stateValues[(int)currentState]) { currentState = (EmotionalState)i; } } if (previousState != currentState && !audioPicker.isPlayingVO) { //This sends out an event that can let other scripts know that the emotional state //has been changed EmotionalStateChanged(); switch (currentState) { case EmotionalState.attention: audioPicker.PlayAttentionClips(); break; case EmotionalState.stress: audioPicker.PlayStressClips(); break; case EmotionalState.relax: audioPicker.PlayRelaxClips(); break; case EmotionalState.meditation: audioPicker.PlayMeditationClips(); break; default: break; } } else { // check to see if we've passed the time limit, then repeat the audio clips sameStateTimer += Time.deltaTime; if (sameStateTimer >= sameStateRepeatTime && !audioPicker.isPlayingVO) { RepeatAudioClips(); } } }
internal void Express(string name, EmotionalState expression, float intensity) { AvatarController controller = getController(name); if (controller == null) { return; } controller.ExpressEmotion(expression, intensity); }
internal void Feel(string name, EmotionalState emotion, float intensity) { AvatarController controller = getController(name); if (controller == null) { return; } controller.SetMood(emotion, intensity); }
private void Valid_Emotional_State() { _emotionalState = new EmotionalState() { EnvironmentGroupId = 3, UserId = 2, CreationDate = DateTime.Now, State = 1, }; }
private void Emotional_State_With_0_Environment_Group_Id() { _emotionalState = new EmotionalState() { EnvironmentGroupId = 0, UserId = 3, CreationDate = DateTime.Now, State = 1, }; }
public void AddEmotionalState([FromBody] EmotionalState emotionalState) { if (emotionalState == null) { throw new ArgumentNullException(nameof(emotionalState)); } emotionalState.UserId = _webPrincipal.UserId; _emotionalStatesService.AddEmotionalState(emotionalState); }
public static void SendEmotionData(EmotionalState state, IPEndPoint destination) { using (var udpSender = new UdpClient()) { var relaxationPacket = CreatePacket("RelaxationRate", (float)state.RelaxationRate); udpSender.Send(relaxationPacket, relaxationPacket.Length, destination); var concentrationPacket = CreatePacket("Meditation", (float)state.ConcentrationRate); udpSender.Send(concentrationPacket, concentrationPacket.Length, destination); } }
private void Valid_Emotional_State() { _emotionalState = new EmotionalState() { CreationDate = DateTime.Now, EnvironmentGroupId = 2, UserId = 3, State = 2, }; _webPricipalMock.Setup(x => x.UserId).Returns(3); }
private void Emotional_States_Should_Equal_Inserted() { using (var db = new TestPsychoCareContext()) { List <EmotionalState> emotionalStatesDb = db.EmotionalStates.Where(x => x.UserId == _userId).ToList(); foreach (EmotionalState expectedEmotionalState in _emotionalStatesList) { EmotionalState emotioanlStateDb = emotionalStatesDb.First(x => x.Id == expectedEmotionalState.Id); emotioanlStateDb.Should().NotBeNull(); } } }
// Use this for initialization void Start() { //osc addresses: //currently there are 4 locations (T3, T4, 01, 02), //each with /alpha, /beta, /gamma, and /theta frequencies //this demo scene maps 3 of the beta values to color, and the 4th to a scale value osc.SetAddressHandler("/Attention", AttentionToStoredFloat); osc.SetAddressHandler("/Stress", StressToStoredFloat); osc.SetAddressHandler("/Relax", RelaxToStoredFloat); osc.SetAddressHandler("/Meditation", MeditationToStoredFloat); stateValues = new float[(int)EmotionalState.numEntries]; currentState = (EmotionalState)4; }
/// <summary> /// Validates and adds emotional state /// if added model has not vlaid datetime then uses server datetime /// </summary> /// <exception cref="ArgumentNullException"/> /// <exception cref="ArgumentException"/> public void AddEmotionalState(EmotionalState emotionalState) { if (emotionalState is null) { throw new ArgumentNullException(nameof(emotionalState)); } emotionalState.Validate(); if (emotionalState.CreationDate == DateTime.MinValue) { emotionalState.CreationDate = DateTime.Now; } _emotionalStatesRepository.AddEmotionalState(emotionalState); }
public static void SendEmotionData(EmotionalState state, IPEndPoint destination) { using (var udpSender = new UdpClient()) { var relaxPacket = CreatePacket("Relax", state.Relax); udpSender.Send(relaxPacket, relaxPacket.Length, destination); var meditationPacket = CreatePacket("Meditation", state.Meditation); udpSender.Send(meditationPacket, meditationPacket.Length, destination); var attentionPacket = CreatePacket("Attention", state.Attention); udpSender.Send(attentionPacket, attentionPacket.Length, destination); var stressPacket = CreatePacket("Stress", state.Stress); udpSender.Send(stressPacket, stressPacket.Length, destination); } }
private void Emotional_State_Is_Null() { _emotionalState = null; }
public NPC(string name, int age, EmotionalState attitude) { _name = name; _age = age; _attitude = attitude; }
public void setEmotion(EmotionalState emotion) { Debug.Log("RHS>>> " + this.name + " emotion is changed to " + emotion + "."); this.emotion = emotion; }
public void ExpressEmotion(EmotionalState expression, float intensity) { parameters.setParameter(AnimatorParams.EXPRESSION_INTENSITY, intensity); animator.SetInteger("Expression", (int)expression); animator.SetTrigger("Express"); }
/// Constructor for the Thing class. The objective is to create a instance of an animate agent. /// All the parameter defines this agent in a similar way of the super class Thing. /// There are just an additional parameter, named emotion, that defines the emotion state of the agent. /// public Human(long objId, string name, string tag, RGBValue color, CartesianPos pos, PhysicalState state, Material mat, string uri, EmotionalState emotion) : base(objId, name, tag, color, pos, state, mat, uri) { this.emotion = emotion; }
public void SetMood(EmotionalState mood, float intensity, float duration = 2.0f) { float finalIntensity = intensity; float[][] preset; switch (mood) { case EmotionalState.NEUTRAL: preset = AvatarParameters.Presets.Neutral(); break; case EmotionalState.HAPPINESS: if (finalIntensity > LOWINTENSITYTHRESHOLD) { preset = AvatarParameters.Presets.HappinessHigh(); } else { preset = AvatarParameters.Presets.HappinessLow(); } break; case EmotionalState.SADNESS: if (finalIntensity > LOWINTENSITYTHRESHOLD) { preset = AvatarParameters.Presets.SadnessHigh(); } else { finalIntensity = finalIntensity * 0.3f; } preset = AvatarParameters.Presets.SadnessLow(); break; case EmotionalState.FEAR: preset = AvatarParameters.Presets.Fear(); break; case EmotionalState.SURPRISE: preset = AvatarParameters.Presets.Surprise(); break; case EmotionalState.ANGER: case EmotionalState.DISGUST: default: preset = AvatarParameters.Presets.Neutral(); break; } parameters.setAllParameters <AnimatorParams>(preset[0]); parameters.setAllParameters <ControllerParams>(preset[1]); finalIntensity = finalIntensity * parameters.getMoodDampenerValue(); if (BubbleSystemUtility.CheckCoroutine(ref corrotina)) { StopCoroutine(corrotina); } corrotina = MoodTransition(animator.GetFloat("Mood Intensity"), finalIntensity, duration); StartCoroutine(corrotina); animator.SetInteger("Mood", (int)mood); animator.SetFloat("Desired Intensity", finalIntensity); }
public void Reset() { _emotionalState = null; _thrownException = null; }
private void insertVision(GameObject go, DateTime dt) { CartesianPos cPos = new CartesianPos(go.transform.position.x, go.transform.position.y, go.transform.position.z); VisionProperties auxVision = go.GetComponent <VisionProperties>(); Status auxStatus = go.GetComponent <Status>(); RGBValue rgb; OntSenseCSharpAPI.Material material = OntSenseCSharpAPI.Material.unknownMaterial; PhysicalState state = PhysicalState.noneState; string tag = go.tag; string uri = ""; if (auxStatus != null) { state = auxStatus.getStatus(); } if (auxVision != null) { rgb = auxVision.getRGB(); material = auxVision.getMaterial(); if (auxVision == vision) { tag = "SelfRobot"; } uri = auxVision.getURI(); } else { rgb = new RGBValue(0, 0, 0); } EmotionalState emotion = EmotionalState.neutralEmotion; EmotionStatus auxEmotion = go.GetComponent <EmotionStatus>(); if (auxEmotion != null) { emotion = auxEmotion.getEmotion(); } RobotVision rv; switch (go.tag) { case Constants.TAG_ROBOT: Robot auxRobot = new Robot(uIDD.getID(go), go.name, tag, rgb, cPos, state, material, uri); rv = new RobotVision(dt, auxRobot); break; case Constants.TAG_HUMAN: Human auxHuman = new Human(uIDD.getID(go), go.name, tag, rgb, cPos, state, material, uri, emotion); rv = new RobotVision(dt, auxHuman); break; default: Thing auxThing = new Thing(uIDD.getID(go), go.name, tag, rgb, cPos, state, material, uri); rv = new RobotVision(dt, auxThing); break; } try // Try to access a resource. { rv.insert(); // using dotNetRDF library inserts the information in the triple store } catch (Exception e) { Debug.Log("System>>> " + e.Message); // change for your: LogError(e); // Call a custom error logging procedure. } }