public TrajectorySubParser_(Chapter chapter, Scene scene) : base(chapter) { this.trajectory = new Trajectory(); //scene.setTrajectory(trajectory); this.scene = scene; }
void Update() { if (trajectory_ != null) { // Move the cannon ball. Vector3 new_pos = transform.position; new_pos += transform.forward * speed_ * Time.deltaTime * speed_multiplier_; float distance_to_start = GetFlatDistance(new_pos, start_pos_); if (distance_to_start > start_distance_) { // if we passed our target, make sure we land at the end. transform.position = target_; trajectory_ = null; OnImpact(target_); } else if (called_near_impact_ == false && ((distance_to_start / start_distance_) > 0.7f)) { // if we passed our target, make sure we land at the end. OnNearImpact(target_); } else { // Otherwise, proceed by getting new height. new_pos.y = trajectory_.GetHeightAtDistance(distance_to_start); transform.position = new_pos; } } if (timer_ > 0.0f) { timer_ -= Time.deltaTime; if (timer_ <= 0.0f) { CannonballPool.Destroy(gameObject); if (explosion_ != null) { explosion_.SetActive(false); } } } }
public CommonMandelbrotDrawer(String uniqueId, String title, String imagePath, Color color, Trajectory trajectory, int iters, DataGroup group, float scaling = 1.0f) : base(uniqueId, title, imagePath, group) { this.color = color; this.trajectory = trajectory; this.iters = iters; this.scaling = scaling; }
public TrajectoryHandler(Trajectory trajectory) { lines = new List<LineHandler> (); foreach (Trajectory.Side side in trajectory.getSides()) { lines.Add (new LineHandler (trajectory.getNodeForId (side.getIDStart ()) , trajectory.getNodeForId (side.getIDEnd ()) , side)); } updateNeighbours (); }
public RetraceSet(string distribution, string dimension, Trajectory track, int iter, bool extended, int numFeat, int model, string stepwiseBias, Features.Mode featureMode, DirectoryInfo data) : base(distribution, dimension, track, iter, extended, numFeat, model, stepwiseBias, data) { Read(); FeatureMode = featureMode; if (FeatureMode != Features.Mode.Local) FileInfo = new FileInfo(FileInfo.FullName.Replace(Features.Mode.Local.ToString(), FeatureMode.ToString())); }
public float Fire(Vector3 at) { start_pos_ = transform.position; target_ = at; // Set the flat look at direction. Vector3 dir = GetFlatDirection(transform.position, at); transform.rotation = Quaternion.LookRotation(dir, Vector3.up); // Get a flat distance. start_distance_ = GetFlatDistance(transform.position, at); trajectory_ = new Trajectory(transform.position.y, at.y, start_distance_, speed_); speed_multiplier_ = Mathf.Min(start_distance_, 15.0f) / 15.0f; return trajectory_.fire_angle_; }
// ---- protected methods ---- protected void CalculatePath() { float anglePitch = GetPitchAngle(originTransform); float angleYaw = GetYawAngle(originTransform); float initialHeight = originTransform.position.y - groundHeight; // FIXME: target height is unknown float distance = Trajectory.DistanceAtAngle(anglePitch, velocity, initialHeight, -Physics.gravity.y); float x = Mathf.Sin(angleYaw) * distance; float y = groundHeight - originTransform.position.y + 5; float z = Mathf.Cos(angleYaw) * distance; Vector3 impactLocation = originTransform.position + new Vector3(x, y, z); // set target position reticleTransform.position = impactLocation; DrawTrajectory(originTransform.position, impactLocation, distance); }
// Update is called once per frame void Update() { target = getEndTarget(); if (jumping && controller.grounded) { jumping = false; controller.movespeed = 15f; move = 1f; } else if (jumping) { Trajectory bestJump = jumpPaths[0]; foreach (Trajectory t in jumpPaths) { if (t.score > bestJump.score) { bestJump = t; } } if (bestJump.speed < 0) { move = -1f; } else { move = 1f; } //target = bestJump.positions[bestJump.positions.Count - 1].x; controller.movespeed = bestJump.speed; } if (transform.position.x < target) { ObstacleCheck(perceptor.chasms); ObstacleCheck(perceptor.elevationIncrease); PlatformCheck(perceptor.platformStarts); controller.move = move; } if (transform.position.x >= target) { controller.move = 0f; } UpdateGenome(); }
public void TestSetUp() { Logger.Debug($"Executing {TestContext.TestName}"); DevKit = new DevKit141Aspect(TestContext); DevKit.Store.CapServerProviders = DevKit.Store.CapServerProviders .Where(x => x.DataSchemaVersion == OptionsIn.DataVersion.Version141.Value) .ToArray(); Well = new Well { Uid = DevKit.Uid(), Name = DevKit.Name("Well"), TimeZone = DevKit.TimeZone }; Wellbore = new Wellbore { Uid = DevKit.Uid(), Name = DevKit.Name("Wellbore"), UidWell = Well.Uid, NameWell = Well.Name, MD = new MeasuredDepthCoord(0, MeasuredDepthUom.ft) }; Log = new Log { Uid = DevKit.Uid(), Name = DevKit.Name("Log"), UidWell = Well.Uid, NameWell = Well.Name, UidWellbore = Wellbore.Uid, NameWellbore = Wellbore.Name }; Trajectory = new Trajectory { Uid = DevKit.Uid(), Name = DevKit.Name("Trajectory"), UidWell = Well.Uid, NameWell = Well.Name, UidWellbore = Wellbore.Uid, NameWellbore = Wellbore.Name }; BeforeEachTest(); OnTestSetUp(); }
public void Init(DialogReceiverInterface e, SceneDataControl scene) { sceneRef = scene; string backgroundPath = Controller.getInstance().getSelectedChapterDataControl().getScenesList().getScenes()[ GameRources.GetInstance().selectedSceneIndex].getPreviewBackground(); backgroundPreviewTex = (Texture2D)Resources.Load(backgroundPath.Substring(0, backgroundPath.LastIndexOf(".")), typeof(Texture2D)); string playerPath = Controller.getInstance().getSelectedChapterDataControl().getPlayer().getPreviewImage(); playerTex = (Texture2D)Resources.Load(playerPath.Substring(0, playerPath.LastIndexOf(".")), typeof(Texture2D)); selectedPlayerTex = (Texture2D)Resources.Load("Editor/SelectedArea", typeof(Texture2D)); editNodeTex = (Texture2D)Resources.Load("EAdventureData/img/icons/nodeEdit", typeof(Texture2D)); editSideTex = (Texture2D)Resources.Load("EAdventureData/img/icons/sideEdit", typeof(Texture2D)); setInitialNodeTex = (Texture2D)Resources.Load("EAdventureData/img/icons/selectStartNode", typeof(Texture2D)); deleteTex = (Texture2D)Resources.Load("EAdventureData/img/icons/deleteTool", typeof(Texture2D)); deleteTex = (Texture2D)Resources.Load("EAdventureData/img/icons/ScaleArea", typeof(Texture2D)); initialNodeTex = (Texture2D)Resources.Load("EAdventureData/img/icons/selectStartNode", typeof(Texture2D)); lineTex = (Texture2D)Resources.Load("Editor/LineTex", typeof(Texture2D)); selectedAreaSkin = (GUISkin)Resources.Load("Editor/ButtonSelected", typeof(GUISkin)); imageBackgroundRect = new Rect(0f, 0f, backgroundPreviewTex.width, backgroundPreviewTex.height); playerRect = new Rect(0f, 0f, playerTex.width, playerTex.height); useTrajectory = sceneRef.getTrajectory().hasTrajectory(); useInitialPosition = useInitialPositionLast = !useTrajectory; trajectory = sceneRef.getTrajectory().GetTrajectory(); x = sceneRef.getDefaultInitialPositionX(); y = sceneRef.getDefaultInitialPositionY(); playerRect = new Rect(x, y, playerTex.width, playerTex.height); base.Init(e, backgroundPreviewTex.width, backgroundPreviewTex.height); }
private void LoadTrajectory(Trajectory trac) { ListViewEx1.SuspendLayout(); ListViewEx1.Items.Clear(); foreach (Vector3 v in trac.Points) { var lvi = new ListViewItem(new string[] { "", v.X.ToString(), v.Y.ToString(), v.Z.ToString() }); lvi.Tag = v; ListViewEx1.Items.Add(lvi); } if (ListViewEx1.Items.Count > 0) { ListViewEx1.Items[0].Selected = true; } ListViewEx1.ResumeLayout(); }
private void btnStart_Click(object sender, EventArgs e) { MM mm = new MM(provider.graph); foreach (String trjFile in trjFiles) { Trajectory trj = new Trajectory(trjFile); Trajectory newTrj = mm.match(trj); String fileName = Path.Combine(outputDir, Path.GetFileName(trjFile)); newTrj.Save(fileName); } String notice = String.Format("Open directory to find the output file(s) in {0}?", outputDir); if (MessageBox.Show(notice, "Mission Complete", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes) { Process.Start(outputDir); } }
/// <summary> /// Return a string in KML format containing all updates /// for the plotted ground path at the given moment in time /// </summary> /// <returns></returns> public string KMLAnimationStep(int i) { string plotgroundCoordinates = ""; Trajectory trajectory = _trajectories[i]; for (int t = 0; t < trajectory.Duration; t++) { plotgroundCoordinates += trajectory.Longitude(t) + "," + trajectory.Latitude(t) + "," + 0 + "\n"; } return(@" <LineString targetId='multipleplotground" + i + @"'> <coordinates> " + plotgroundCoordinates + @" </coordinates> </LineString> "); }
private void CalculateBounds() { if (Trajectory == null) { return; } var size = Size * Coef; var t = 0f; while (t < 1f) { t = Trajectory.Travel(t, size / 2); BoundsList.Add(new Bounds(Trajectory.Position(t), Vector3.one * size)); } BoundsList.Add(new Bounds(Trajectory.Position(0), Vector3.one * Size)); BoundsList.Add(new Bounds(Trajectory.Position(1), Vector3.one * Size)); }
public void MoveInDirection(Vector3 direction, float strength, Guid teamId) { Trajectory = null; var force = direction * strength; var torque = (direction * -1) * strength; _simulationController.SimulateLandingSpot(gameObject, force, torque); _lastTeamId = teamId; _rigidbody.AddTorque(torque); _rigidbody.AddForce(force, ForceMode.Force); ChangedDirection?.Invoke(this, new BallChangedDirectionEvent { LandingSpot = LandingSpot, LastTouchTeamId = teamId }); // DrawTrajectory(); audioSource?.Play(); }
private List <TableToInsert> GetArraysToInserts() { //var mudList = MudPlan.Select(x => (IExcelItem) x).ToList(); //mudList.AddRange(Mud.Select(x => (IExcelItem)x).ToList()); //if (!mudList.Any()) // mudList.Add(new ExcelDrillingReportMudPlanItem()); return(new List <TableToInsert> { //ExcelHelper.GetTable("Сonstruction", Сonstruction.Select(x => (IExcelItem)x).ToList()), //ExcelHelper.GetTable("Knbk", Knbk.Select(x => (IExcelItem)x).ToList()), ExcelHelper.GetTable("Trajectory", Trajectory.Select(x => (IExcelItem)x).ToList()), //ExcelHelper.GetTable("Bit", Bit.Select(x => (IExcelItem)x).ToList()), //ExcelHelper.GetTable("Gti", Gti.Select(x => (IExcelItem)x).ToList()), //ExcelHelper.GetTable("NightGti", NightGti.Select(x => (IExcelItem)x).ToList()), //ExcelHelper.GetTable("Mud", mudList), }); }
public void CreateMainPoint() { GameObject ball = Instantiate(this.ball, this.transform); ball.name = "Ball"; if (trajectory != null) { trajectory.AddMainPoint(ball); } else { trajectory = new Trajectory(ball); } TextMesh text = ball.GetComponentInChildren <TextMesh>(); text.text = (trajectory.NumMainPoint()).ToString(); }
public static void Main(string[] args) { Planet planet = new Planet(60000,9.81,60000); Trajectory traj = new Trajectory(planet, new Vector3D(0, 120000, 0), new Vector3D(1000, 1000, 0)); bool cancel=true; while (cancel) { traj.Step(); Console.WriteLine(traj.pos+" "+traj.vel); if (traj.pos.Magnitude() < planet.Radius) { //cancel = false; //break; } } Console.ReadLine(); }
public TrajectoryHandler(Trajectory trajectory) { if (trajectory == null) { return; } this.trajectory = trajectory; lines = new List <LineHandler>(); foreach (Trajectory.Side side in trajectory.getSides()) { lines.Add(new LineHandler(trajectory.getNodeForId(side.getIDStart()) , trajectory.getNodeForId(side.getIDEnd()) , side)); } updateNeighbours(); }
public void ShouldReturnCopyFromSearch() { var trajectory1 = new Trajectory(); var tp1 = new TrajectoryPoint(trajectory1); Db.Insert(trajectory1); Db.Insert(tp1); var founded = Db.Search <TrajectoryPoint>(tp => tp.Trajectory.Id == trajectory1.Id).First(); founded.Trajectory = new Trajectory(); var newFounded = Db.Search <TrajectoryPoint>(tp => tp.Trajectory.Id == trajectory1.Id).First(); Assert.Equal(founded.Id, newFounded.Id); Assert.NotEqual(founded.Trajectory.Id, newFounded.Trajectory.Id); }
public float Fire(Vector3 at) { start_pos_ = transform.position; target_ = at; // Set the flat look at direction. Vector3 dir = GetFlatDirection(transform.position, at); transform.rotation = Quaternion.LookRotation(dir, Vector3.up); // Get a flat distance. start_distance_ = GetFlatDistance(transform.position, at); trajectory_ = new Trajectory(transform.position.y, at.y, start_distance_, speed_); speed_multiplier_ = Mathf.Min(start_distance_, 15.0f) / 15.0f; return(trajectory_.fire_angle_); }
private void Trajectory141DataAdapter_GetFromStore_Filters_Results_With_No_Data(int numberOfStations) { // Add well and wellbore AddParents(); // Add trajectory with stations Trajectory.TrajectoryStation = DevKit.TrajectoryStations(20, 10, inCludeExtra: true); DevKit.AddAndAssert(Trajectory); // Query end range before the trajectory structure var end = 9; var query = new Trajectory { Uid = Trajectory.Uid, UidWell = Trajectory.UidWell, UidWellbore = Trajectory.UidWellbore, MDMax = new MeasuredDepthCoord { Uom = Trajectory141Generator.MdUom, Value = end } }; DevKit.GetAndAssert<TrajectoryList, Trajectory>(query, queryByExample: true, isNotNull: false); // Query start range after the trajectory structure var start = 100; query = new Trajectory { Uid = Trajectory.Uid, UidWell = Trajectory.UidWell, UidWellbore = Trajectory.UidWellbore, MDMin = new MeasuredDepthCoord { Uom = Trajectory141Generator.MdUom, Value = start }, }; DevKit.GetAndAssert<TrajectoryList, Trajectory>(query, queryByExample: true, isNotNull: false); // Query range outside the trajectory structure start = 2; end = 5; query = new Trajectory { Uid = Trajectory.Uid, UidWell = Trajectory.UidWell, UidWellbore = Trajectory.UidWellbore, MDMin = new MeasuredDepthCoord { Uom = Trajectory141Generator.MdUom, Value = start }, MDMax = new MeasuredDepthCoord { Uom = Trajectory141Generator.MdUom, Value = end } }; DevKit.GetAndAssert<TrajectoryList, Trajectory>(query, queryByExample: true, isNotNull: false); }
public virtual void CommitJump() { if (Trajectory == null || !Trajectory.Active) { return; } if (Trajectory is ChargeTrajectory chargeTrajectory) { _audioManager.PlaySound(_audioSource, _chargeJumpSound, .3f); if (chargeTrajectory.Collides && (chargeTrajectory.Focusable == null || !chargeTrajectory.Focusable.IsSilent)) { _audioManager.PlaySound(_audioSource, _impactSound); _poolManager.GetPoolable <SoundEffect>(ChargeDestination, Quaternion.identity, 5); } } else { _audioManager.PlaySound(_audioSource, _normalJumpSound); } Trajectory.StartFading(); if (Trajectory is ChargeTrajectory c) { c.Bonuses.ForEach(x => x.Take()); c.Interactives.ForEach(x => x.Activate()); if (c.Target == null) { return; } //Bounce Bounce(c.Target.Transform.position); c.Target.Die(Transform); c.Target = null; GainJumps(1); _timeManager.SlowDown(); _timeManager.StartTimeRestore(); } }
public void Trajectory141DataAdapter_GetFromStore_Returns_Data_Only_Large_Trajectory() { // Add well and wellbore AddParents(); // Add trajectory with 1000 stations var stationsLoaded = 100; var added = false; while (stationsLoaded <= 1000) { Trajectory.TrajectoryStation = DevKit.TrajectoryStations(100, stationsLoaded + 1); Trajectory.TrajectoryStation.ForEach(x => x.Uid = DevKit.Uid()); if (added) DevKit.UpdateAndAssert(Trajectory); else DevKit.AddAndAssert(Trajectory); added = true; stationsLoaded += 100; } // Get trajectory short errorCode; var trajectoryQuery = new Trajectory() { Uid = Trajectory.Uid, UidWell = Trajectory.UidWell, UidWellbore = Trajectory.UidWellbore }; var result = DevKit.QueryWithErrorCode<TrajectoryList, Trajectory>( trajectoryQuery, out errorCode, ObjectTypes.Trajectory, null, OptionsIn.ReturnElements.DataOnly); Assert.AreEqual((short)ErrorCodes.Success, errorCode, "Returned all data."); Assert.IsNotNull(result); Assert.AreEqual(1, result.Count); var traj = result[0]; Assert.IsNotNull(traj); Assert.AreEqual(1000, traj.TrajectoryStation.Count); traj.TrajectoryStation.ForEach(x => Assert.IsTrue(x.MD.Value > 0)); Assert.AreEqual(101, traj.TrajectoryStation.Min(x => x.MD.Value)); Assert.AreEqual(1100, traj.TrajectoryStation.Max(x => x.MD.Value)); }
public LineHandler(Trajectory.Node start, Trajectory.Node end, Trajectory.Side side) { this.start = start; this.end = end; this.side = side; float start_x = start.getX()/LineHandler.DIVISOR, end_x = end.getX()/LineHandler.DIVISOR , start_y = 60f - start.getY()/LineHandler.DIVISOR, end_y = 60f - end.getY()/LineHandler.DIVISOR; min_x = Mathf.Min(start_x, end_x); max_x = Mathf.Max(start_x, end_x); min_y = Mathf.Min(start_y, end_y); max_y = Mathf.Max(start_y, end_y); this.function = new MathFunction(new Vector2(start_x,start_y) ,new Vector2(end_x,end_y)); this.scale_function = new MathFunction(new Vector2(start_x,start.getScale()), new Vector2(end_x,end.getScale())); }
override protected void ResponseStateEndedEvent(object sender, System.EventArgs e) { for (int i = 0; i < controller.getCurrentState().getTrajectoryCount(); i++) { Trajectory tra = controller.getCurrentState().getTrajectory(i); if (tra.hitFeedback != null) { ignoreCollisionTrunkWithLowerArm(false); /* * if(isIgnoreCollisionWithOthers){ * for(int j = 0; j < RFGameManager.instance.getEnemyCount(); j++){ * ignoreCollisionARBWithOtherBipedal(character.getArticulatedRigidBody(tra.hitFeedback.hitARBIndex), RFGameManager.instance.getEnemy(j)); * } * }*/ } } base.ResponseStateEndedEvent(sender, e); }
public static DrawBase Draw(this DrawBase drawer, Trajectory trajectory, Color color, float width) { var draw = Graphics.FromImage(drawer.Image); var points = trajectory.GeoPoints.ToList().Select(t => { if (drawer.AutoFitScale == 1) { return(new PointF(t.Longitude, t.Latitude)); } var h = t.Latitude - drawer.MinY; h *= drawer.AutoFitScale; var w = t.Longitude - drawer.MinX; w *= drawer.AutoFitScale; return(new PointF(w, h)); }).ToArray(); draw.DrawLines(new Pen(color, width), points); return(drawer); }
// Token: 0x06002BC1 RID: 11201 RVA: 0x000B9104 File Offset: 0x000B7304 private void Advance() { if (NetworkServer.active) { if (this.projectileSimple) { this.projectileSimple.velocity = 0f; this.projectileSimple.enabled = false; } if (base.rigidbody) { base.rigidbody.velocity = new Vector3(0f, Trajectory.CalculateInitialYSpeedForFlightDuration(DroneProjectilePrepHover.duration), 0f); } } if (base.isAuthority) { this.outer.SetNextState(new DroneProjectilePrepHover()); } }
public static GameObject CreateNewParticle(GameObject spawnObject, Trajectory trajectory, Transform parent) { //Create new instance a particle var particle = Instantiate(spawnObject, trajectory.StartPoint, Quaternion.identity, parent); //Store his trajectory particle.GetComponent <FollowStream>().Trajectory = trajectory; //Change color //particle.GetComponent<Renderer>().material = trajectory.GetParticleMaterial(particle.GetComponent<Renderer>().material); var renderer = particle.GetComponent <Renderer>(); renderer.GetPropertyBlock(MaterialPropertyBlock); MaterialPropertyBlock.SetColor("_Color", trajectory.Color); renderer.SetPropertyBlock(MaterialPropertyBlock); return(particle); }
void Awake() { TargetDirection = new Vector3(Root.forward.x, 0f, Root.forward.z); TargetVelocity = Vector3.zero; Positions = new Vector3[Joints.Length]; Forwards = new Vector3[Joints.Length]; Ups = new Vector3[Joints.Length]; Velocities = new Vector3[Joints.Length]; Trajectory = new Trajectory(111, Controller.Styles.Length, Root.position, TargetDirection); Trajectory.Postprocess(); APFNN.Initialise(); int start = 8 * PointSamples; int lh = start + 10 * 12 + 9; int rh = start + 15 * 12 + 9; int lf = start + 19 * 12 + 9; int rf = start + 23 * 12 + 9; for (int i = lh; i < lh + 3; i++) { APFNN.AddControlNeuron(i); } for (int i = rh; i < rh + 3; i++) { APFNN.AddControlNeuron(i); } for (int i = lf; i < lf + 3; i++) { APFNN.AddControlNeuron(i); } for (int i = rf; i < rf + 3; i++) { APFNN.AddControlNeuron(i); } for (int i = 0; i < Joints.Length; i++) { Positions[i] = Joints[i].position; Forwards[i] = Joints[i].forward; Ups[i] = Joints[i].up; Velocities[i] = Vector3.zero; } }
private void Shoot() { float projectileSpeed = projectilePrefab.GetComponent <Projectile>().speed; Vector3 dir; if (accountForBulletDrop) { dir = Trajectory.Calculate(toPlayer, projectileSpeed); } else { dir = playerTransform.position - projectileReleaseTransform.position; } Projectile projectile = Instantiate(projectilePrefab, projectileReleaseTransform.position, Quaternion.identity).GetComponent <Projectile>(); projectile.Release(dir, gameObject); }
public void Calculate(AlgorithmType t) { InitializeProcessToRun(t); Debug.Assert(processToRun != null); AbstractNetworkContainer containerToChange = (AbstractNetworkContainer)container.Clone(); Double timeStep = 0; Double currentTracingStep = tracingStepIncrement, currentActiveNodesCount = containerToChange.GetActiveNodesCount(); Trajectory.Add(timeStep, currentActiveNodesCount / containerToChange.Size); if (visualMode) { Byte[] bits = new Byte[containerToChange.GetActiveStatuses().Length + 1]; containerToChange.GetActiveStatuses().CopyTo(bits, 0); BitArray arr = new BitArray(bits); ActivesInformation.Add(arr); } while (timeStep <= stepCount && currentActiveNodesCount != 0) { processToRun(containerToChange); currentActiveNodesCount = containerToChange.GetActiveNodesCount(); Trajectory.Add(++timeStep, currentActiveNodesCount / containerToChange.Size); if (visualMode) { Byte[] bits = new Byte[containerToChange.GetActiveStatuses().Length + 1]; containerToChange.GetActiveStatuses().CopyTo(bits, 0); BitArray arr = new BitArray(bits); ActivesInformation.Add(arr); } network.UpdateStatus(NetworkStatus.StepCompleted); // TODO closed Trace /*if (TraceCurrentStep(timeStep, currentTracingStep, "ActivationAlgorithm_1")) * { * currentTracingStep += TracingStepIncrement; * network.UpdateStatus(NetworkStatus.StepCompleted); * }*/ } Debug.Assert(timeStep > stepCount || !containerToChange.DoesActiveNodeExist()); }
public void ShouldInsertManyToManyIfFkSatisfy() { var trajectory = new Trajectory(); var graphic = new Graphic(); var trajectoryGraphic = new TrajectoryGraphicRelationalTable(trajectory, graphic); Db.CreateManyToMany <Trajectory, Graphic, TrajectoryGraphicRelationalTable>(tgr => tgr.Trajectory.Id, tgr => tgr.Graphic.Id); Db.Insert(trajectory); Db.Insert(graphic); Db.Insert(trajectoryGraphic); Assert.True(1 == Db.Count <Trajectory>()); Assert.True(1 == Db.Count <Graphic>()); Assert.True(1 == Db.Count <TrajectoryGraphicRelationalTable>()); Assert.Equal(trajectory.Id, Db.GetAll <TrajectoryGraphicRelationalTable>().First().Trajectory.Id); Assert.Equal(graphic.Id, Db.GetAll <TrajectoryGraphicRelationalTable>().First().Graphic.Id); }
public void VehicleCapabilityConstructor() { //Arrange var payloadRange = new PayloadRange(250, 800); var trajectory = new Trajectory(120000, 110000, 33.2, "LEO"); var vehicleCapability = new VehicleCapability(payloadRange, trajectory); var expected = new List <object> { payloadRange, trajectory }; //Act var actual = new List <object> { vehicleCapability.PayloadRange, vehicleCapability.Trajectory }; //Assert CollectionAssert.AreEqual(expected, actual); }
// Token: 0x06002964 RID: 10596 RVA: 0x000AE168 File Offset: 0x000AC368 protected virtual void UpdateTrajectoryInfo(out AimThrowableBase.TrajectoryInfo dest) { dest = default(AimThrowableBase.TrajectoryInfo); Ray aimRay = base.GetAimRay(); RaycastHit raycastHit = default(RaycastHit); bool flag = false; if (this.rayRadius > 0f && Util.CharacterSpherecast(base.gameObject, aimRay, this.rayRadius, out raycastHit, this.maxDistance, LayerIndex.CommonMasks.bullet, QueryTriggerInteraction.UseGlobal) && raycastHit.collider.GetComponent <HurtBox>()) { flag = true; } if (!flag) { flag = Util.CharacterRaycast(base.gameObject, aimRay, out raycastHit, this.maxDistance, LayerIndex.CommonMasks.bullet, QueryTriggerInteraction.UseGlobal); } if (flag) { dest.hitPoint = raycastHit.point; dest.hitNormal = raycastHit.normal; } else { dest.hitPoint = aimRay.GetPoint(this.maxDistance); dest.hitNormal = -aimRay.direction; } Vector3 vector = dest.hitPoint - aimRay.origin; if (this.useGravity) { float num = this.projectileBaseSpeed; Vector2 vector2 = new Vector2(vector.x, vector.z); float magnitude = vector2.magnitude; float y = Trajectory.CalculateInitialYSpeed(magnitude / num, vector.y); Vector3 a = new Vector3(vector2.x / magnitude * num, y, vector2.y / magnitude * num); dest.speedOverride = a.magnitude; dest.finalRay = new Ray(aimRay.origin, a / dest.speedOverride); dest.travelTime = Trajectory.CalculateGroundTravelTime(num, magnitude); return; } dest.speedOverride = this.projectileBaseSpeed; dest.finalRay = aimRay; dest.travelTime = this.projectileBaseSpeed / vector.magnitude; }
/// <summary> /// Filters the station data based on query parameters. /// </summary> /// <param name="entity">The entity.</param> /// <param name="stations">The trajectory stations.</param> /// <param name="parser">The parser.</param> /// <param name="context">The query context</param> /// <returns>The count of trajectory stations after filtering.</returns> protected override int FilterStationData(Trajectory entity, List <TrajectoryStation> stations, WitsmlQueryParser parser = null, IQueryContext context = null) { if (stations == null || stations.Count == 0) { return(0); } var range = GetQueryIndexRange(parser); entity.TrajectoryStation = range.Start.HasValue ? range.End.HasValue ? stations.Where(s => s.MD.Value >= range.Start.Value && s.MD.Value <= range.End.Value).ToList() : stations.Where(s => s.MD.Value >= range.Start.Value).ToList() : range.End.HasValue ? stations.Where(s => s.MD.Value <= range.End.Value).ToList() : stations; return(entity.TrajectoryStation.Count); }
private void DrawTrajectoryGizmos(Trajectory trajectory, Color color, Color colorStable) { if (trajectory == null || trajectory.IsEmpty()) { return; } // // // var prevPosition = trajectory.points.Head.Item1; // foreach (var position in trajectory.Positions(1)) // { // Gizmos.color = color; // if (trajectory.isStable) // { // Gizmos.color = colorStable; // } // // Handles.DrawWireDisc(position, Vector3.up, 0.1f); // Gizmos.DrawLine(prevPosition, position); // prevPosition = position; // } if (!trajectory.IsEmpty() && trajectory.IsInterupted()) { Handles.color = Color.red; Handles.DrawWireDisc(trajectory.points.Tail.Item1, Vector3.up, radius); } if (trajectory.isAnalyzed) { Handles.color = Color.magenta; if (inOrbitAround) { var eNormalized = _trajectory.e.normalized; var planetPos = inOrbitAround.transform.position; Gizmos.color = Color.green; Gizmos.DrawLine(planetPos, planetPos + eNormalized * _trajectory.rPeriapsis); Gizmos.color = Color.red; Gizmos.DrawLine(planetPos, planetPos + eNormalized * -_trajectory.rApoapsis); } } }
public PreferenceSet(string distribution, string dimension, Trajectory track, int iter, bool extended, int numFeat, int model, string stepwiseBias, Ranking rank, Features.Mode featMode, DirectoryInfo data) : base(distribution, dimension, track, iter, extended, numFeat, model, stepwiseBias, featMode, data) { FileInfo trainingFileInfo = new FileInfo(FileInfo.FullName); this.FileInfo = new FileInfo(string.Format( @"{0}\Training\{1}.diff.{2}.csv", data.FullName, FileInfo.Name.Substring(0, FileInfo.Name.Length - FileInfo.Extension.Length), (char) rank)); Data.Columns.Add("Rank", typeof (int)); var ranking = rank; switch (ranking) { case Ranking.All: _rankingFunction = AllRankings; break; case Ranking.Basic: _rankingFunction = BasicRanking; break; case Ranking.FullPareto: _rankingFunction = FullParetoRanking; break; case Ranking.PartialPareto: _rankingFunction = PartialParetoRanking; break; } if (FeatureMode == Features.Mode.Local) ApplyAll(Retrace, null, null); else Read(trainingFileInfo); _diffData = new List<Preference>[NumInstances, NumDimension]; for (int pid = 1; pid <= AlreadySavedPID; pid++) for (int step = 0; step < NumDimension; step++) _diffData[pid - 1, step] = new List<Preference>(); }
/** * @param trajectory * the trajectory to set */ public void setTrajectory(Trajectory trajectory) { this.trajectory = trajectory; }
public TrainingSet(string distribution, string dimension, Trajectory track, bool extended, DirectoryInfo data, int numFeatures, int modelID, string stepwiseBias) : this(distribution, dimension, track, -1, extended, numFeatures, modelID, stepwiseBias, data) { }
public bool containsNode(Trajectory.Node node) { return (start == node) || (end == node); }
public Trajectory.Node getOtherPoint(Trajectory.Node point) { if (start == point) return end; else if(end == point) return start; return null; }
public TrajectoryMandelbrotDrawer(String uniqueId, String title, String imagePath, Color color, Trajectory trajectory, int iters, DataGroup group) : base(uniqueId, title, imagePath, color, trajectory, iters, group, 3) { }
public TrajectoryMandelbrotView(Mandelbrot engine, Trajectory trajectory, int screenWidth, int screenHeight) { this.engine = engine; this.trajectory = trajectory; this.screenHeight = screenHeight; this.screenWidth = screenWidth; updateState(); }
public DynamicTrajectory(Trajectory initial, Func<Trajectory, Trajectory> updater) { this.innerTrajectory = initial; this.updater = updater; }
internal TrainingSet(string distribution, string dimension, Trajectory track, int iter, bool extended, int numFeatures, int modelID, string stepwiseBias, DirectoryInfo data) : base(distribution, dimension, DataSet.train, extended, data) { Track = track; string strTrack = track.ToString(); NumInstances = ResetNumInstances(extended); NumTraining = ResetNumInstances(false); switch (Track) { case Trajectory.ILFIXSUP: case Trajectory.ILSUP: case Trajectory.ILUNSUP: strTrack = GetImitationModel(out Model, out _beta, ref iter, extended, numFeatures, modelID, stepwiseBias); if (Track == Trajectory.ILUNSUP) _trajectory = ChooseWeightedJob; else _trajectory = UseImitationLearning; if (extended) { AlreadySavedPID = Math.Max(AlreadySavedPID, NumTraining*iter); NumInstances = Math.Min(Data.Rows.Count, NumTraining*(iter + 1)); } break; case Trajectory.CMAESMINCMAX: GetCMAESModel(out Model, CMAESData.ObjectiveFunction.MinimumMakespan); _trajectory = ChooseWeightedJob; break; case Trajectory.CMAESMINRHO: GetCMAESModel(out Model, CMAESData.ObjectiveFunction.MinimumRho); _trajectory = ChooseWeightedJob; break; case Trajectory.OPT: Model = null; _trajectory = ChooseOptJob; break; case Trajectory.LOCOPT: Model = null; _trajectory = ChooseLocalOptJob; break; default: // SDR Model = new LinearModel((SDRData.SDR) Track, distribution, Dimension); _trajectory = ChooseSDRJob; break; } if (extended) strTrack += "EXT"; FileInfo = new FileInfo(string.Format( @"{0}\Training\trdat.{1}.{2}.{3}.{4}.csv", data.FullName, Distribution, Dimension, strTrack, FeatureMode)); Data.Columns.Add("Step", typeof (int)); Data.Columns.Add("Dispatch", typeof (Schedule.Dispatch)); Data.Columns.Add("Followed", typeof (bool)); Data.Columns.Add("ResultingOptMakespan", typeof (int)); Data.Columns.Add("Features", typeof (Features)); SetAlreadySavedPID(); Preferences = new List<Preference>[NumInstances, NumDimension]; }
public void SetTrajectory(Trajectory newPattern) { trajectory = newPattern; }
public static Vector2 nodeToVector2(Trajectory.Node node) { return new Vector2 (node.getX () / LineHandler.DIVISOR, 60f - node.getY () / LineHandler.DIVISOR); }
public void stepTime() { this.innerTrajectory = updater.Invoke(this.innerTrajectory); }