protected override void OnCreateManager() { settings = TimeMachineSettings.experiment; LoadDensityValues(); counter = 0; random.InitState(324341); weibul0_25 = new NativeArray <float>(5000, Allocator.Persistent); weibul0_5 = new NativeArray <float>(5000, Allocator.Persistent); weibul0_75 = new NativeArray <float>(5000, Allocator.Persistent); weibul1_0 = new NativeArray <float>(5000, Allocator.Persistent); weibul1_25 = new NativeArray <float>(5000, Allocator.Persistent); weibul1_5 = new NativeArray <float>(5000, Allocator.Persistent); weibul1_75 = new NativeArray <float>(5000, Allocator.Persistent); weibul2_0 = new NativeArray <float>(5000, Allocator.Persistent); weibul2_25 = new NativeArray <float>(5000, Allocator.Persistent); weibul2_5 = new NativeArray <float>(5000, Allocator.Persistent); }
protected override JobHandle OnUpdate(JobHandle inputDeps) { settings = TimeMachineSettings.experiment; counter++; if (counter == settings.StartFrame) { ECvalue = EC(agentGroup.Length, settings.agentArea, settings.obstacleNumber, settings.obstacleWeight, settings.worldArea, settings.obstacleArea); Debug.Log("jumped"); var TimeJumpJob = new TimeJumpPDR() { AgentGoals = agentGroup.AgentGoal, AgentPos = agentGroup.Position, AgentStep = agentGroup.AgentStep, TimeJump = settings.FrameLeap, weibul0_25 = weibul0_25, weibul0_5 = weibul0_5, weibul0_75 = weibul0_75, weibul1_0 = weibul1_0, weibul1_25 = weibul1_25, weibul1_5 = weibul1_5, weibul1_75 = weibul1_75, weibul2_0 = weibul2_0, weibul2_25 = weibul2_25, weibul2_5 = weibul2_5, cellDensities = m_cellSystem.LocalDensities, EnvironmentalComplexity = ECvalue }; var TimeJumpJobDeps = TimeJumpJob.Schedule(agentGroup.Length, Settings.BatchSize, inputDeps); TimeJumpJobDeps.Complete(); return(TimeJumpJobDeps); } return(inputDeps); }
public void Awake() { var folder = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments); var bioCrowdsFolder = System.IO.Directory.CreateDirectory(folder + "\\VHLAB\\BioCrowds"); string settingsFile = bioCrowdsFolder.FullName + "\\TimeExperiment.json"; bool basisCase = System.IO.File.Exists(settingsFile); Debug.Log(basisCase + " " + settingsFile); if (!basisCase) { System.IO.File.WriteAllText(settingsFile, JsonUtility.ToJson(experiment, true)); } else { string file = System.IO.File.ReadAllText(settingsFile); experiment = JsonUtility.FromJson <TimeExperiment>(file); } }