private void Start() { _td00 = new Test_Data(); _tdArr = new Test_Data[] { new Test_Data("Name00", 100), new Test_Data("Name01", 101) }; _tdList = new List <Test_Data>(_tdArr); _tdArr_Serialized = new Test_Data[] { new Test_Data("Name00", 100), new Test_Data("Name01", 101) }; _tdList_Serialized = _tdList; _tdListCore = new Test_Data_ListIncluded(); _tdListCore._tdList = _tdList; _tdArrayCore = new Test_Data_ArrayIncluded(); _tdArrayCore._tdArr = _tdArr; // 가능 Debug.Log(JsonUtility.ToJson(_td00)); // 불가능 Debug.Log(JsonUtility.ToJson(_tdArr)); Debug.Log(JsonUtility.ToJson(_tdList)); Debug.Log(JsonUtility.ToJson(_tdArr_Serialized)); Debug.Log(JsonUtility.ToJson(_tdList_Serialized)); // 가능 Debug.Log(JsonUtility.ToJson(_tdListCore)); Debug.Log(JsonUtility.ToJson(_tdArrayCore)); }
public void SetData(StreamReader reader, StreamReader reader_2 = null) { reader.DiscardBufferedData(); reader.BaseStream.Seek(0, System.IO.SeekOrigin.Begin); string line; while ((line = reader.ReadLine()) != null) { int Sign; double[] Vector = new double[68]; string[] splitstring = line.Split(); if (splitstring.First().First() == '+') { Sign = +1; } else { Sign = -1; } foreach (var item in splitstring) { if (item.Contains(":")) { string[] s = item.Split(':'); Vector[Convert.ToInt32(s[0]) - 1] = Convert.ToDouble(s[1]); } } Training_Data.Add(new Entry(Sign, Vector)); } if (reader_2 != null) { reader_2.DiscardBufferedData(); reader_2.BaseStream.Seek(0, System.IO.SeekOrigin.Begin); string line2; while ((line2 = reader_2.ReadLine()) != null) { int Sign; double[] Vector = new double[68]; string[] splitstring = line2.Split(); if (splitstring.First().First() == '+') { Sign = +1; } else { Sign = -1; } foreach (var item in splitstring) { if (item.Contains(":")) { string[] s = item.Split(':'); Vector[Convert.ToInt32(s[0]) - 1] = Convert.ToDouble(s[1]); } } Test_Data.Add(new Entry(Sign, Vector)); } } }
public static Common.Business.Test_Data Fetch(Test_Data data) { Common.Business.Test_Data item = (Common.Business.Test_Data)Activator.CreateInstance(typeof(Common.Business.Test_Data)); //using (ObjectFactory.BypassPropertyChecks(item)) { item.DataCode = data.DataCode; item.DataName = data.DataName; item.DataAmt = data.DataAmt; } ObjectFactory.MarkAsChild(item); ObjectFactory.MarkOld(item); return(item); }
public void SetTrainingData() { foreach (var item in data_1) { Training_Data.Add(new TrainingData(ScreenNameLength(item.Vector[0]), DescriptionLength(item.Vector[1]), Days(item.Vector[2]), Hours(item.Vector[3]), MinSec(item.Vector[4]), MinSec(item.Vector[5]), Follow(item.Vector[6]), Follow(item.Vector[7]), Ratio(item.Vector[8]), Tweets(item.Vector[9]), TweetsPerDay(item.Vector[10]), AverageLinks(item.Vector[11]), AverageLinks(item.Vector[12]), AverageUsername(item.Vector[13]), AverageUsername(item.Vector[14]), ChangeRate(item.Vector[15]), item.Sign)); } foreach (var item in data_2) { Test_Data.Add(new TrainingData(ScreenNameLength(item.Vector[0]), DescriptionLength(item.Vector[1]), Days(item.Vector[2]), Hours(item.Vector[3]), MinSec(item.Vector[4]), MinSec(item.Vector[5]), Follow(item.Vector[6]), Follow(item.Vector[7]), Ratio(item.Vector[8]), Tweets(item.Vector[9]), TweetsPerDay(item.Vector[10]), AverageLinks(item.Vector[11]), AverageLinks(item.Vector[12]), AverageUsername(item.Vector[13]), AverageUsername(item.Vector[14]), ChangeRate(item.Vector[15]), item.Sign)); } }