Exemple #1
0
    private IEnumerator SimulationCoroutine(float lambda, float pReturnFirst)
    {
        Debug.Log(lambda + " Start.");

        var userModel = new VRInterfaceModel();

        userModel.Lambda       = lambda;
        userModel.dataSet      = dataSet;
        userModel.allNodeCount = allNodeCount;
        userModel.goalCount    = goalNodeCount;
        userModel.meanDegree   = meanDegree;
        // userModel.distanceFtoG = distanceFtoG;
        // 始点ノードに戻る確率
        userModel.pReturnFirst = pReturnFirst;
        for (int i = 0; i < maxEpoc; i++)
        {
            progress = (float)i / (float)maxEpoc;
            userModel.Simulate();

            yield return(null);
        }

        SimDataWriter.WriteData(userModel.Records, dataSet, "lambda_" + lambda.ToString("F1").Replace(".", "_") + ".csv", userModel);
        Debug.Log(lambda + " Done.");
        yield break;
    }
Exemple #2
0
    private void Simulate(float lambda, float pReturnFirst)
    {
        Debug.Log(lambda + " Start.");

        var userModel = new VRInterfaceModel();

        userModel.Lambda       = lambda;
        userModel.dataSet      = dataSet;
        userModel.allNodeCount = allNodeCount;
        userModel.goalCount    = goalNodeCount;
        userModel.meanDegree   = meanDegree;
        // userModel.distanceFtoG = distanceFtoG;
        userModel.pSelectVisibleGoal = selectVisibleGoal;
        // 始点ノードに戻る確率
        userModel.pReturnFirst = pReturnFirst;
        for (int i = 0; i < maxEpoc; i++)
        {
            progress = (float)i / (float)maxEpoc;
            var success = false;
            while (!success)
            {
                success = userModel.Simulate();
            }

            Thread.Sleep(16);
        }

        SimDataWriter.WriteData(userModel.Records, dataSet, "lambda_" + lambda.ToString("F1").Replace(".", "_") + ".csv", userModel);
        Debug.Log(lambda + " Done.");
    }