public override void Randomize() { int arraylength = -1; Random rand = new Random(); int strlength; byte[] strbuf, myByte; //footsteps arraylength = rand.Next(10); if (footsteps == null) { footsteps = new Messages.humanoid_nav_msgs.StepTarget[arraylength]; } else { Array.Resize(ref footsteps, arraylength); } for (int i = 0; i < footsteps.Length; i++) { //footsteps[i] footsteps[i] = new Messages.humanoid_nav_msgs.StepTarget(); footsteps[i].Randomize(); } //feedback_frequency feedback_frequency = (rand.Next() + rand.NextDouble()); }
public override void Randomize() { int arraylength = -1; Random rand = new Random(); int strlength; byte[] strbuf, myByte; //result result = rand.Next(2) == 1; //footsteps arraylength = rand.Next(10); if (footsteps == null) { footsteps = new Messages.humanoid_nav_msgs.StepTarget[arraylength]; } else { Array.Resize(ref footsteps, arraylength); } for (int i = 0; i < footsteps.Length; i++) { //footsteps[i] footsteps[i] = new Messages.humanoid_nav_msgs.StepTarget(); footsteps[i].Randomize(); } //costs costs = (rand.Next() + rand.NextDouble()); //final_eps final_eps = (rand.Next() + rand.NextDouble()); //planning_time planning_time = (rand.Next() + rand.NextDouble()); //expanded_states expanded_states = (System.Int64)(rand.Next() << 32) | rand.Next(); }
public override byte[] Serialize(bool partofsomethingelse) { int currentIndex = 0, length = 0; bool hasmetacomponents = false; byte[] thischunk, scratch1, scratch2; List <byte[]> pieces = new List <byte[]>(); GCHandle h; //step if (step == null) { step = new Messages.humanoid_nav_msgs.StepTarget(); } pieces.Add(step.Serialize(true)); //combine every array in pieces into one array and return it int __a_b__f = pieces.Sum((__a_b__c) => __a_b__c.Length); int __a_b__e = 0; byte[] __a_b__d = new byte[__a_b__f]; foreach (var __p__ in pieces) { Array.Copy(__p__, 0, __a_b__d, __a_b__e, __p__.Length); __a_b__e += __p__.Length; } return(__a_b__d); }
public override void Deserialize(byte[] SERIALIZEDSTUFF, ref int currentIndex) { int arraylength = -1; bool hasmetacomponents = false; object __thing; int piecesize = 0; byte[] thischunk, scratch1, scratch2; IntPtr h; //executed_footsteps hasmetacomponents |= true; arraylength = BitConverter.ToInt32(SERIALIZEDSTUFF, currentIndex); currentIndex += Marshal.SizeOf(typeof(System.Int32)); if (executed_footsteps == null) { executed_footsteps = new Messages.humanoid_nav_msgs.StepTarget[arraylength]; } else { Array.Resize(ref executed_footsteps, arraylength); } for (int i = 0; i < executed_footsteps.Length; i++) { //executed_footsteps[i] executed_footsteps[i] = new Messages.humanoid_nav_msgs.StepTarget(SERIALIZEDSTUFF, ref currentIndex); } }
public override void Randomize() { int arraylength = -1; Random rand = new Random(); int strlength; byte[] strbuf, myByte; //executed_footsteps arraylength = rand.Next(10); if (executed_footsteps == null) { executed_footsteps = new Messages.humanoid_nav_msgs.StepTarget[arraylength]; } else { Array.Resize(ref executed_footsteps, arraylength); } for (int i = 0; i < executed_footsteps.Length; i++) { //executed_footsteps[i] executed_footsteps[i] = new Messages.humanoid_nav_msgs.StepTarget(); executed_footsteps[i].Randomize(); } }
public override void Randomize() { int arraylength = -1; Random rand = new Random(); int strlength; byte[] strbuf, myByte; //step step = new Messages.humanoid_nav_msgs.StepTarget(); step.Randomize(); }
//[System.Diagnostics.DebuggerStepThrough] public override void Deserialize(byte[] SERIALIZEDSTUFF, ref int currentIndex) { int arraylength = -1; bool hasmetacomponents = false; int piecesize = 0; byte[] thischunk, scratch1, scratch2; IntPtr h; object __thing; //step step = new Messages.humanoid_nav_msgs.StepTarget(SERIALIZEDSTUFF, ref currentIndex); }
public override void Deserialize(byte[] SERIALIZEDSTUFF, ref int currentIndex) { int arraylength = -1; bool hasmetacomponents = false; object __thing; int piecesize = 0; byte[] thischunk, scratch1, scratch2; IntPtr h; //footsteps hasmetacomponents |= true; arraylength = BitConverter.ToInt32(SERIALIZEDSTUFF, currentIndex); currentIndex += Marshal.SizeOf(typeof(System.Int32)); if (footsteps == null) { footsteps = new Messages.humanoid_nav_msgs.StepTarget[arraylength]; } else { Array.Resize(ref footsteps, arraylength); } for (int i = 0; i < footsteps.Length; i++) { //footsteps[i] footsteps[i] = new Messages.humanoid_nav_msgs.StepTarget(SERIALIZEDSTUFF, ref currentIndex); } //feedback_frequency piecesize = Marshal.SizeOf(typeof(double)); h = IntPtr.Zero; if (SERIALIZEDSTUFF.Length - currentIndex != 0) { h = Marshal.AllocHGlobal(piecesize); Marshal.Copy(SERIALIZEDSTUFF, currentIndex, h, piecesize); } if (h == IntPtr.Zero) { throw new Exception("Alloc failed"); } feedback_frequency = (double)Marshal.PtrToStructure(h, typeof(double)); Marshal.FreeHGlobal(h); currentIndex += piecesize; }
public override byte[] Serialize(bool partofsomethingelse) { int currentIndex = 0, length = 0; bool hasmetacomponents = false; byte[] thischunk, scratch1, scratch2; List <byte[]> pieces = new List <byte[]>(); GCHandle h; //footsteps hasmetacomponents |= true; if (footsteps == null) { footsteps = new Messages.humanoid_nav_msgs.StepTarget[0]; } pieces.Add(BitConverter.GetBytes(footsteps.Length)); for (int i = 0; i < footsteps.Length; i++) { //footsteps[i] if (footsteps[i] == null) { footsteps[i] = new Messages.humanoid_nav_msgs.StepTarget(); } pieces.Add(footsteps[i].Serialize(true)); } //feedback_frequency scratch1 = new byte[Marshal.SizeOf(typeof(double))]; h = GCHandle.Alloc(scratch1, GCHandleType.Pinned); Marshal.StructureToPtr(feedback_frequency, h.AddrOfPinnedObject(), false); h.Free(); pieces.Add(scratch1); //combine every array in pieces into one array and return it int __a_b__f = pieces.Sum((__a_b__c) => __a_b__c.Length); int __a_b__e = 0; byte[] __a_b__d = new byte[__a_b__f]; foreach (var __p__ in pieces) { Array.Copy(__p__, 0, __a_b__d, __a_b__e, __p__.Length); __a_b__e += __p__.Length; } return(__a_b__d); }
public override void Randomize() { int arraylength = -1; Random rand = new Random(); int strlength; byte[] strbuf, myByte; //start_left start_left = new Messages.humanoid_nav_msgs.StepTarget(); start_left.Randomize(); //start_right start_right = new Messages.humanoid_nav_msgs.StepTarget(); start_right.Randomize(); //goal_left goal_left = new Messages.humanoid_nav_msgs.StepTarget(); goal_left.Randomize(); //goal_right goal_right = new Messages.humanoid_nav_msgs.StepTarget(); goal_right.Randomize(); }
public override byte[] Serialize(bool partofsomethingelse) { int currentIndex = 0, length = 0; bool hasmetacomponents = false; byte[] thischunk, scratch1, scratch2; List <byte[]> pieces = new List <byte[]>(); GCHandle h; //executed_footsteps hasmetacomponents |= true; if (executed_footsteps == null) { executed_footsteps = new Messages.humanoid_nav_msgs.StepTarget[0]; } pieces.Add(BitConverter.GetBytes(executed_footsteps.Length)); for (int i = 0; i < executed_footsteps.Length; i++) { //executed_footsteps[i] if (executed_footsteps[i] == null) { executed_footsteps[i] = new Messages.humanoid_nav_msgs.StepTarget(); } pieces.Add(executed_footsteps[i].Serialize(true)); } //combine every array in pieces into one array and return it int __a_b__f = pieces.Sum((__a_b__c) => __a_b__c.Length); int __a_b__e = 0; byte[] __a_b__d = new byte[__a_b__f]; foreach (var __p__ in pieces) { Array.Copy(__p__, 0, __a_b__d, __a_b__e, __p__.Length); __a_b__e += __p__.Length; } return(__a_b__d); }