public void ForwardTest3() { var topology = new Forward(states: 3, deepness: 2); double[,] actualA; double[] actualPi; double[,] expectedA; double[] expectedPi; int actualStates = topology.Create(true, out actualA, out actualPi); int expectedStates = topology.Create(false, out expectedA, out expectedPi); for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { Assert.AreEqual(actualA[i, j], System.Math.Log(expectedA[i, j])); } } for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { Assert.AreEqual(actualPi[i], System.Math.Log(expectedPi[i])); } } Assert.AreEqual(actualStates, expectedStates); Assert.AreEqual(actualStates, 3); }
public ViewTransform(RtPoint from, RtPoint to, RtVector up) { Up = up; To = to; From = from; Forward = (To - From).Normalize(); var upNormalized = Up.Normalize(); Left = Forward.Cross(upNormalized); var trueUp = Left.Cross(Forward); var orientation = RtMatrix.Identity; orientation.M11 = Left.X; orientation.M12 = Left.Y; orientation.M13 = Left.Z; orientation.M21 = trueUp.X; orientation.M22 = trueUp.Y; orientation.M23 = trueUp.Z; orientation.M31 = -Forward.X; orientation.M32 = -Forward.Y; orientation.M33 = -Forward.Z; var translation = RtMatrix.Identity; translation.M14 = -from.X; translation.M24 = -from.Y; translation.M34 = -from.Z; Matrix = orientation * translation; }
private void updateUI () { switch (_currentMode) { case SPEED_MODE.PAUSE: Pause.SetActive (true); Forward.SetActive (true); FastForward.SetActive (false); SuperFastForward.SetActive (false); break; case SPEED_MODE.NORMAL: Pause.SetActive (false); Forward.SetActive (true); FastForward.SetActive (false); SuperFastForward.SetActive (false); break; case SPEED_MODE.FAST: Pause.SetActive (false); Forward.SetActive (false); FastForward.SetActive (true); SuperFastForward.SetActive (false); break; case SPEED_MODE.SUPAFAST: Pause.SetActive (false); Forward.SetActive (false); FastForward.SetActive (false); SuperFastForward.SetActive (true); break; } }
public void ToBinary(BinaryWriter writer) { writer.Write(Index); writer.Write(UserID); writer.Write(ConfigID); writer.Write(TeamIndex); Position.ToBinary(writer); Forward.ToBinary(writer); writer.Write(Level); writer.Write(HP); writer.Write(MP); writer.Write(Properties.Count); foreach (var i in Properties) { i.ToBinary(writer); } writer.Write((int)TDamage); writer.Write((int)TDefance); writer.Write((int)Category); var Name_bytes = Encoding.UTF8.GetBytes(Name == null?string.Empty:Name); writer.Write(Name_bytes.Length); writer.Write(Name_bytes); writer.Write(Speed); writer.Write(Magics.Count); foreach (var i in Magics) { i.ToBinary(writer); } }
void TriggerForward() { if (Forward != null) { Forward.Invoke(this, new EventArgs()); } }
public static string TrainingMode = "bayes"; //switch to "markov" to try the Hidden Markov model public void TrainHiddenMarkovModel(List <string[]> trainingData) { Accord.Math.Random.Generator.Seed = 42; // Dummy data var nodePairs = trainingData.ToArray(); // Transform data to sequence of integer labels using a codification codebook: var codebook = new Codification("Nodes", nodePairs); // Create the training data for the models: var sequence = codebook.Transform("Nodes", nodePairs); // Specify a forward topology var topology = new Forward(4); var symbols = codebook["Nodes"].NumberOfSymbols; // Create the hidden Markov model var hmm = new HiddenMarkovModel(topology, symbols); // Create the learning algorithm var teacher = new BaumWelchLearning(hmm); // Teach the model teacher.Learn(sequence); // Use the Serializer class to save model and codebook Serializer.Save(codebook, "thesaurus_codebook.accord"); Serializer.Save(hmm, "thesaurus_HMModel.accord"); }
public void visit(Forward forward) { forward.expression.accept(this); #if (UNCOMMENT) Turtle.Forward(forward.expression.output); #endif }
public override double CalcPv(Forward <Bond> trade, IMarketCondition market) { var zeroSpread = GetUnderlyingBondZeroSpread(trade.Underlying, market); var bfMarket = market.UpdateCondition(new UpdateMktConditionPack <IYieldCurve>(x => x.UnderlyingDiscountCurve, market.UnderlyingDiscountCurve.Value.GetSpreadedCurve(zeroSpread))); return(base.CalcPv(trade, bfMarket)); }
public void Draw(Effect effect) { if (UpVisible) { Up.Draw(effect); } if (DownVisible) { Down.Draw(effect); } if (ForwardVisible) { Forward.Draw(effect); } if (BackwardVisible) { Backward.Draw(effect); } if (LeftVisible) { Left.Draw(effect); } if (RightVisible) { Right.Draw(effect); } }
void InternalAdd(T1 t1, T2 t2) { try { if (t1 == null || t2 == null) { throw new ArgumentException("Null key value", "Null value is not allowed."); } if (Forward.ContainsKey(t1) || Reverse.ContainsKey(t2)) { throw new System.ArgumentException("A pair with same item already exist!"); } else { Forward.Add(t1, t2); Reverse.Add(t2, t1); } } catch (Exception e) { // throw new System.Exception("BiMap: Unknow exception in Add()."); throw e; } }
public HrefLookup(string contents) : this() { var json = JsonConvert.DeserializeObject <dynamic>(contents); foreach (dynamic category in json.categories) { var url = category.pageURL.ToString(); var id = category.id.ToString(); if (!string.IsNullOrEmpty(url) && !string.IsNullOrEmpty(id)) { var href = string.Format("{0}{1}", (url != null && !url.StartsWith(Config.Params.HrefPrefix) ? Config.Params.HrefPrefix : string.Empty), url); if (Forward.Get(href) == null) { Forward.Add(href, id); } if (Reverse.Get(id) == null) { Reverse.Add(id, href); } } } }
public void Deinit() { // Environment StaticAirTemperature.Remove(); StaticPressure.Remove(); // Orbit Apoapsis.Remove(); Periapsis.Remove(); TimeToApoapsis.Remove(); // Vessel Altitude.Remove(); AngularVelocity.Remove(); AvailablePosTorque.Remove(); AvailableRCSForce.Remove(); AvailableThrust.Remove(); AvailableTorque.Remove(); Direction.Remove(); DryMass.Remove(); Forward.Remove(); Mass.Remove(); MaxVacuumThrust.Remove(); MomentOfInertia.Remove(); Position.Remove(); Right.Remove(); Thrust.Remove(); Up.Remove(); VacuumSpecificImpulse.Remove(); Velocity.Remove(); }
public Node <INode> GetNode(string nodeName) { switch (nodeName) { case Forward.NAME: var nodeForward = new Forward() as INode; return(new Node <INode> (nodeForward)); case Vec3.NAME: INode nodeVec3 = new Vec3() as INode; return(new Node <INode>(nodeVec3)); case SplitVec3.NAME: INode nodeSplitVec3 = new SplitVec3() as INode; return(new Node <INode>(nodeSplitVec3)); case LookAtPosition.NAME: INode nodeLookAt = new LookAtPosition() as INode; return(new Node <INode>(nodeLookAt)); case ScreenToWorld.NAME: INode nodeScreenToWorld = new ScreenToWorld() as INode; return(new Node <INode>(nodeScreenToWorld)); default: return(null); } }
public void Add(T1 t1, T2 t2) { t1 = GetIndex(t1); t2 = GetIndex(t2); if (Forward.ContainsKey(t1)) { return; } lock (_locker) { if (Forward.ContainsKey(t1)) { return; } _forward = _forward.Add(t1, t2); _reverse = _reverse.Add(GetIndex(t2), t1); var forward = new Indexer <T1, T2>(_forward); var reverse = new Indexer <T2, T1>(_reverse); Interlocked.Exchange(ref _forwardIndexer, forward); Interlocked.Exchange(ref _reverseIndexer, reverse); } }
private void LoadAndTrain_Click(object sender, EventArgs e) { List <int> outputLabels = new List <int>(); List <int[]> inputSequences = new List <int[]>(); OpenFileDialog dlg = new OpenFileDialog(); dlg.Filter = "Gestures (*.xml)|*.xml"; dlg.Title = "Load Gestures"; dlg.RestoreDirectory = false; dlg.Multiselect = true; if (dlg.ShowDialog(this) == DialogResult.OK) { lblResult.Text = "Training..."; for (int i = 0; i < dlg.FileNames.Length; i++) { string name = dlg.FileNames[i]; List <int[]> inputSequencesTemp = _rec.LoadDirectionalCodewordsFile(name); for (int j = 0; j < inputSequencesTemp.Count; j++) { inputSequences.Add(inputSequencesTemp[j]); outputLabels.Add(i); } } ReloadViewForm(); } //ITopology forward = new Forward(4,3); ITopology[] forwards = new Forward[4]; forwards[0] = new Forward(5, 3); forwards[1] = new Forward(5, 3); forwards[2] = new Forward(5, 3); forwards[3] = new Forward(5, 3); _hmmc = new HiddenMarkovClassifier(4, forwards, 16); //hmmc.Models[0] = new HiddenMarkovModel(); //hmmc.Models[0].Transitions = null;kovModel(); // And create a algorithms to teach each of the inner models var teacher = new HiddenMarkovClassifierLearning(_hmmc, // We can specify individual training options for each inner model: modelIndex => new BaumWelchLearning(_hmmc.Models[modelIndex]) { Tolerance = 0.001, // iterate until log-likelihood changes less than 0.001 Iterations = 0 // don't place an upper limit on the number of iterations }); teacher.Run((int[][])inputSequences.ToArray(), (int[])outputLabels.ToArray()); _hmmc.Threshold = teacher.Threshold(); _hmmc.Sensitivity = 1; _hmms = _hmmc.Models; for (int i = 0; i < dlg.FileNames.Length; i++) { _hmms[i].Tag = Gesture.ParseName(dlg.FileNames[i]); } lblResult.Text = "Success!!"; }
//public void OnCollisionEnter(Collision collision) //{ // print(name); //} public void OnCollision(Forward fv) { //print(fv.name); if (fv.rigidbody == null) { return; } var g = fv.collision.transform.root.gameObject; var vel = fv.collision.impactForceSum.magnitude; SetLife(Mathf.Max(0, vel - 10)); if (vel < 6) { return; } if (g.tag == "Destroyable") { Game.Destruct(g.transform, fv.transform.position, 300); } if (g.tag == "Enemy") { var z = g.GetComponent <Destroyable>(); if (z != null && z.alive) { z.Die(fv.collision.contacts[0].point, 500); } } }
private void DoSetVisualRotation(Vector2d rot) { lastVisualRot = visualRot; visualRot = Quaternion.Euler(Quaternion.LookRotation(Forward.ToVector3(0f)).eulerAngles + _rotationOffset); // visualRot = Quaternion.LookRotation(Forward.ToVector3(0f)); SetRotationBuffer = true; }
public override int GetHashCode() { int hash = 1; if (Issuer.Length != 0) { hash ^= Issuer.GetHashCode(); } hash ^= audiences_.GetHashCode(); if (jwksSourceSpecifierCase_ == JwksSourceSpecifierOneofCase.RemoteJwks) { hash ^= RemoteJwks.GetHashCode(); } if (jwksSourceSpecifierCase_ == JwksSourceSpecifierOneofCase.LocalJwks) { hash ^= LocalJwks.GetHashCode(); } if (Forward != false) { hash ^= Forward.GetHashCode(); } hash ^= fromHeaders_.GetHashCode(); hash ^= fromParams_.GetHashCode(); if (ForwardPayloadHeader.Length != 0) { hash ^= ForwardPayloadHeader.GetHashCode(); } hash ^= (int)jwksSourceSpecifierCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
private void Button_KeyDown_Forward(object sender, KeyEventArgs e) { if (e.Key == Key.Right) { Forward?.Invoke(this, new RoutedEventArgs()); } }
void Awake() { if (instance == null) { instance = this; } }
public void MergeFrom(FunctionReply other) { if (other == null) { return; } sideEffects_.Add(other.sideEffects_); switch (other.ResponseCase) { case ResponseOneofCase.Reply: if (Reply == null) { Reply = new global::Cloudstate.Reply(); } Reply.MergeFrom(other.Reply); break; case ResponseOneofCase.Forward: if (Forward == null) { Forward = new global::Cloudstate.Forward(); } Forward.MergeFrom(other.Forward); break; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); }
/// <summary> /// Get TLV element hash code. /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked { return(Value.GetHashCode() + Type.GetHashCode() + Forward.GetHashCode() + NonCritical.GetHashCode()); } }
public void Pitch(double angle) { Vector3D right = Right; Forward = Forward.Rotate(right, angle); Down = Down.Rotate(right, angle); }
public ValueTask <Forward?> UseForwardAsync(Current current) { var f = new Forward(); f.H = new Hidden(); f.H.F = f; return(new ValueTask <Forward?>(f)); }
public Forward UseForward(Current current) { var f = new Forward(); f.H = new Hidden(); f.H.F = f; return(f); }
public Forward useForward(Ice.Current current) { var f = new Forward(); f.h = new Hidden(); f.h.f = f; return(f); }
public void UpdateVisuals() { if (!Forward.EqualsZero()) { cachedTransform.rotation = Quaternion.LookRotation(Forward.ToVector3()); } cachedTransform.position = this.Position.ToVector3(); }
useForwardAsync(Ice.Current current) { var f = new Forward(); f.h = new Hidden(); f.h.f = f; return(Task.FromResult(f)); }
public void CheckingForForward() { string Path = TestContext.CurrentContext.TestDirectory + "\\" + ConfigurationManager.AppSettings["bigAttachName"]; Forward f = new Forward(); Assert.IsTrue(f.ForwardMailToAnotherUser(Path)); }
public Forward UseForward(Current current, CancellationToken cancel) { var f = new Forward(); f.H = new Hidden(); f.H.F = f; return(f); }
private void Setup() { _moveDirection = Vector3.zero; animation.wrapMode = WrapMode.Loop; //делаем анимацию прыжка в один проход //размещение анимации прыжка в отдельном слое показано для примера //использования многослойной анимации animation[a_Jump.name].layer = 1; animation[a_Jump.name].wrapMode = WrapMode.Once; animation.Stop(); //останавливаем любую анимацию, заданную по умолчанию animation[a_Idle.name].speed = a_IdleSpeed; animation[a_Run.name].speed = a_RunSpeed; animation[a_Walk.name].speed = a_WalkSpeed; animation[a_Strafe.name].speed = a_StrafeSpeed; animation.Play(a_Idle.name); _turn = MovementExt.Turn.none; _strafe = MovementExt.Turn.none; _forward = MovementExt.Forward.none; _run = false; _jump = false; _state = MovementExt.State.Run; }
//public void OnCollisionEnter(Collision collision) //{ // print(name); //} public void OnCollision(Forward fv) { //print(fv.name); if (fv.rigidbody == null) return; var g = fv.collision.transform.root.gameObject; var vel = fv.collision.impactForceSum.magnitude; SetLife(Mathf.Max(0, vel - 10)); if (vel < 6) return; if (g.tag == "Destroyable") { Game.Destruct(g.transform, fv.transform.position, 300); } if (g.tag == "Enemy") { var z = g.GetComponent<Destroyable>(); if (z != null && z.alive) z.Die(fv.collision.contacts[0].point, 500); } }
private void SetUp() { _moveDirection = Vector3.zero; //zero our the vector3 we will use for moving our player animation.Stop(); //stop any animations that might be set to play automatically animation.wrapMode = WrapMode.Loop; //set all animations to loop by default if(jumpAnimName != "") { animation[jumpAnimName].layer = -1; //move jump to a higher layer animation[jumpAnimName].wrapMode = WrapMode.Once; //set jump to only play once } animation.Play(idleAnimName); //start the idle animation when the script starts _turn = AdvancedMovement.Turn.none; _forward = AdvancedMovement.Forward.none; _strafe = Turn.none; _run = true; _jump = false; _isSwimming = false; _state = AdvancedMovement.State.Run; }
public void response_useForward(Forward f) { AllTests.test(f != null); callback.called(); }
public override void useForward(out Forward f, Ice.Current current) { f = new Forward(); f.h = new Hidden(); f.h.f = f; }
private void Setup() { _moveDirection = Vector3.zero; animation.Stop(); animation.wrapMode = WrapMode.Loop; animation["idle"].layer = 1; animation["idle"].wrapMode = WrapMode.Once; animation.Play("idle"); _turn = Movement.Turn.none; _forward = Movement.Forward.none; _strafe = Movement.Turn.none; _run = false; _jump = false; _state = Movement.State.Run; }
public override void useForward_async(AMD_TestIntf_useForward cb, Ice.Current current) { Forward f = new Forward(); f = new Forward(); f.h = new Hidden(); f.h.f = f; cb.ice_response(f); }
public override Task<Forward> useForwardAsync(Ice.Current current) { var f = new Forward(); f = new Forward(); f.h = new Hidden(); f.h.f = f; return Task.FromResult<Forward>(f); }
private void Setup() { _moveDirection = Vector3.zero; _turn = Movement.Turn.none; _forward = Movement.Forward.none; _strafe = Movement.Turn.none; _run = false; _jump = false; _state = State.Run; }
private void SetUp() { _moveDirection = Vector3.zero; //zero vector3 use for moving player animation.Stop(); //stop animation if there have automatically play animation.wrapMode = WrapMode.Loop; //set all animation to loop by default animation[jumpAnimName].layer = 1; animation[jumpAnimName].wrapMode = WrapMode.Once; animation.Play(idleAnimName); _turn = AdvancedMovement.Turn.none; _forward = AdvancedMovement.Forward.none; _strafe = Turn.none; _run = false; _jump = false; _state = AdvancedMovement.State.Run; }
public void MoveMeForward(Forward z) { _forward = z; }