private void GenerateGraphs(bool newEcosystem)
    {
        string title = (
            referenceAttemptIdx == Constants.ID_NOT_SET ?
            "Initial config" :
            String.Format("Attempt #{0}", referenceAttemptIdx + 1)
            );              //hide 0 start from user

        CSVObject graph1CSV = (referenceAttemptIdx == Constants.ID_NOT_SET) ?
                              ecosystemList [ecosystem_idx].csv_default_object :
                              attemptList [referenceAttemptIdx].csv_object;

        if (newEcosystem)
        {
            //destroy prior bargraph if it exists
            //Note: barGraph is regenerated when requested
            if (barGraph != null)
            {
                Destroy(barGraph);
                barGraph = null;
            }

            GenerateFoodWeb();

            graphs = new GraphsCompare(
                graph1CSV,
                ecosystemList [ecosystem_idx].csv_target_object,
                leftGraph,
                topGraph,
                widthGraph,
                heightGraph,
                title,
                "Target Graph",
                ecosystemList [ecosystem_idx].timesteps,
                foodWeb,
                manager
                );
        }
        else
        {
            graphs.UpdateGraph1Data(graph1CSV, title);
        }
    }
예제 #2
0
    private void GenerateGraphs(bool newEcosystem)
    {
        string title = (
            referenceAttemptIdx == Constants.ID_NOT_SET ?
            "Initial config" :
            String.Format ("Attempt #{0}", referenceAttemptIdx + 1)
            );  //hide 0 start from user

        CSVObject graph1CSV = (referenceAttemptIdx == Constants.ID_NOT_SET) ?
            ecosystemList [ecosystem_idx].csv_default_object :
                attemptList [referenceAttemptIdx].csv_object;

        if (newEcosystem) {
            //destroy prior bargraph if it exists
            //Note: barGraph is regenerated when requested
            if (barGraph != null) {
                Destroy (barGraph);
                barGraph = null;
            }

            GenerateFoodWeb ();

            graphs = new GraphsCompare (
                graph1CSV,
                ecosystemList [ecosystem_idx].csv_target_object,
                leftGraph,
                topGraph,
                widthGraph,
                heightGraph,
                title,
                "Target Graph",
                ecosystemList [ecosystem_idx].timesteps,
                foodWeb,
                manager
            );

        } else {
            graphs.UpdateGraph1Data (graph1CSV, title);
        }
    }