コード例 #1
0
        protected override JobHandle OnUpdate(JobHandle inputDeps)
        {
            var calculateMoveStepJob = new CalculateAgentMoveStep()
            {
                AgentData       = agentGroup.AgentData,
                AgentGoals      = agentGroup.AgentGoal,
                AgentPos        = agentGroup.Position,
                AgentStep       = agentGroup.AgentStep,
                AgentTotalW     = totalWeightSystem.AgentTotalMarkerWeight,
                AgentMarkersMap = markerSystem.AgentMarkers,
                Counter         = agentGroup.Counter
            };

            var calculateMoveStepDeps = calculateMoveStepJob.Schedule(agentGroup.Length, Settings.BatchSize, inputDeps);

            calculateMoveStepDeps.Complete();

            return(calculateMoveStepDeps);
        }
コード例 #2
0
        protected override JobHandle OnUpdate(JobHandle inputDeps)
        {
            if (Settings.experiment.BioCloudsEnabled)
            {
                var calculateMoveStepJob = new CalculateAgentMoveStepCloudCohesion()
                {
                    AgentData       = agentGroup.AgentData,
                    AgentGoals      = agentGroup.AgentGoal,
                    AgentPos        = agentGroup.Position,
                    AgentStep       = agentGroup.AgentStep,
                    AgentTotalW     = totalWeightSystem.AgentTotalMarkerWeight,
                    AgentMarkersMap = markerSystem.AgentMarkers,
                    BioCloudsCell2OwningCloudMap = m_BioCloudsCellMarkSystem.Cell2OwningCloud,
                    BioClouds2PosMap             = m_BioCloudsCellTagSystem.cloudIDPositions,
                    AgentCloudID = agentGroup.AgentCloudID
                };

                var calculateMoveStepDeps = calculateMoveStepJob.Schedule(agentGroup.Length, Settings.BatchSize, inputDeps);

                calculateMoveStepDeps.Complete();

                return(calculateMoveStepDeps);
            }
            else
            {
                var calculateMoveStepJob = new CalculateAgentMoveStep()
                {
                    AgentData       = agentGroup.AgentData,
                    AgentGoals      = agentGroup.AgentGoal,
                    AgentPos        = agentGroup.Position,
                    AgentStep       = agentGroup.AgentStep,
                    AgentTotalW     = totalWeightSystem.AgentTotalMarkerWeight,
                    AgentMarkersMap = markerSystem.AgentMarkers,
                    AgentCloudID    = agentGroup.AgentCloudID
                };

                var calculateMoveStepDeps = calculateMoveStepJob.Schedule(agentGroup.Length, Settings.BatchSize, inputDeps);

                calculateMoveStepDeps.Complete();

                return(calculateMoveStepDeps);
            }
        }