// Update is called once per frame
    void Update()
    {
        BarChart barChart = GetComponent <BarChart>();

        barChart.DataSource.SetValue("Unemployed", "Native Born", MigrationFramework.getSpecificPopValue("usUnEm") / 1000);
        barChart.DataSource.SetValue("Not in Workforce", "Native Born", MigrationFramework.getSpecificPopValue("usNotWorking") / 1000);
        barChart.DataSource.SetValue("Unemployed", "Foreign Born", MigrationFramework.getSpecificPopValue("frUnEm") / 1000);
        barChart.DataSource.SetValue("Not in Workforce", "Foreign Born", MigrationFramework.getSpecificPopValue("frNotWorking") / 1000);
    }
    // Update is called once per frame
    void Update()
    {
        BarChart barChart = GetComponent <BarChart>();

        //if (barChart != null) {
        //barChart.DataSource.SlideValue( "Some HS", "Native Born", 20, 4f);
        barChart.DataSource.SetValue("Native Born", "All", MigrationFramework.getSpecificPopValue("usInc") / 1000);
        barChart.DataSource.SetValue("Legal Migrant", "All", MigrationFramework.getSpecificPopValue("frLegalInc") / 1000);
        barChart.DataSource.SetValue("Illegal Migrant", "All", MigrationFramework.getSpecificPopValue("frIllegalInc") / 1000);

        //}
    }
    public long getPop(int key)
    {
        switch (key)
        {
        case 1:
            return(MigrationFramework.getFrPop());

        case 2:
            return(MigrationFramework.getUsPop());

        default:
            return(-1);
        }
    }
Example #4
0
    // Update is called once per frame
    void Update()
    {
        BarChart barChart = GetComponent <BarChart>();

        barChart.DataSource.SetValue("Below HS", "Foreign Born", MigrationFramework.getSpecificPopValue("frLessThanHighschool") / 1000);
        barChart.DataSource.SetValue("Some HS", "Foreign Born", MigrationFramework.getSpecificPopValue("frHighschool") / 1000);
        barChart.DataSource.SetValue("HS Grad", "Foreign Born", MigrationFramework.getSpecificPopValue("frHighschoolGrad") / 1000);
        barChart.DataSource.SetValue("Some College", "Foreign Born", MigrationFramework.getSpecificPopValue("frTwoYear") / 1000);
        barChart.DataSource.SetValue("Bachelors", "Foreign Born", MigrationFramework.getSpecificPopValue("frBachelors") / 1000);
        barChart.DataSource.SetValue("Other", "Foreign Born", MigrationFramework.getSpecificPopValue("frOther") / 1000);

        barChart.DataSource.SetValue("Below HS", "Native Born", MigrationFramework.getSpecificPopValue("usLessThanHighschool") / 1000);
        barChart.DataSource.SetValue("Some HS", "Native Born", MigrationFramework.getSpecificPopValue("usHighschool") / 1000);
        barChart.DataSource.SetValue("HS Grad", "Native Born", MigrationFramework.getSpecificPopValue("usHighschoolGrad") / 1000);
        barChart.DataSource.SetValue("Some College", "Native Born", MigrationFramework.getSpecificPopValue("usTwoYear") / 1000);
        barChart.DataSource.SetValue("Bachelors", "Native Born", MigrationFramework.getSpecificPopValue("usBachelors") / 1000);
        barChart.DataSource.SetValue("Other", "Native Born", MigrationFramework.getSpecificPopValue("usOther") / 1000);
    }
    public void jailPolicy(bool up)
    {
        float[] values = { -0.001f, -0.001f, -0.001f, -0.001f };
        if (!up)
        {
            values = Array.ConvertAll(values, f => f * -1);
        }

        string[] keys = { "usInc", "frInc", "frLegalInc", "frIllegalInc" };

        MigrationFramework.policyChange(values, keys);
        updateAllData();
        if (up)
        {
            jailPolicyLevel++;
        }
        else
        {
            jailPolicyLevel--;
        }
        jailPolicyText.text = "Level: " + jailPolicyLevel;
    }
    public void jobPolicy(bool up)
    {
        float[] values = { -0.004f, -0.004f };
        if (!up)
        {
            values = Array.ConvertAll(values, f => f * -1);
        }

        string[] keys = { "usUnEm", "frUnEm" };

        MigrationFramework.policyChange(values, keys);
        updateAllData();
        if (up)
        {
            jobPolicyLevel++;
        }
        else
        {
            jobPolicyLevel--;
        }
        jobPolicyText.text = "Level: " + jobPolicyLevel;
    }
    private void updateAllData()
    {
        currentYearText.text = "Current Year: " + currentYear;
        frPopText.text       = "Foreign born Population: " + MigrationFramework.getFrPop();
        usPopText.text       = "Native born Population: " + MigrationFramework.getUsPop();

        migrantsText.text = "NE Migrants: " + MigrationFramework.getSpecificPopValue("neMigrants")
                            + "\nMW Migrants: " + MigrationFramework.getSpecificPopValue("mwMigrants")
                            + "\nSouth Migrants: " + MigrationFramework.getSpecificPopValue("sMigrants")
                            + "\nWest Migrants: " + MigrationFramework.getSpecificPopValue("wMigrants");

        usEdText.text = "Below High School: " + MigrationFramework.getSpecificPopValue("usLessThanHighschool")
                        + "\nSome High School: " + MigrationFramework.getSpecificPopValue("usHighschool")
                        + "\nHigh School Diploma: " + MigrationFramework.getSpecificPopValue("usHighschoolGrad")
                        + "\nTwo Year Diploma: " + MigrationFramework.getSpecificPopValue("usTwoYear")
                        + "\nBachelors Diploma: " + MigrationFramework.getSpecificPopValue("usBachelors")
                        + "\nOther: " + MigrationFramework.getSpecificPopValue("usOther");

        frEdText.text = "Below High School: " + MigrationFramework.getSpecificPopValue("frLessThanHighschool")
                        + "\nSome High School: " + MigrationFramework.getSpecificPopValue("frHighschool")
                        + "\nHigh School Diploma: " + MigrationFramework.getSpecificPopValue("frHighschoolGrad")
                        + "\nTwo Year Diploma: " + MigrationFramework.getSpecificPopValue("frTwoYear")
                        + "\nBachelors Diploma: " + MigrationFramework.getSpecificPopValue("frBachelors")
                        + "\nOther: " + MigrationFramework.getSpecificPopValue("frOther");

        usIncText.text = "Incarceration Number: " + MigrationFramework.getSpecificPopValue("usInc");

        frIncText.text = "Incarceration Number: " + MigrationFramework.getSpecificPopValue("frInc")
                         + "\nLegal Incarceration: " + MigrationFramework.getSpecificPopValue("frLegalInc")
                         + "\nIllegal Incarceration: " + MigrationFramework.getSpecificPopValue("frIllegalInc");

        usUnemText.text = "Unemployment Number: " + MigrationFramework.getSpecificPopValue("usUnEm")
                          + "\nOut of Work Force: " + MigrationFramework.getSpecificPopValue("usUnEm");

        frUnemText.text = "Unemployment Number: " + MigrationFramework.getSpecificPopValue("frUnEm")
                          + "\nOut of Work Force: " + MigrationFramework.getSpecificPopValue("frNotWorking");
    }
    public void educationPolicy(bool up)
    {
        float[] values = { -0.011f, 0.004f, 0.003f, 0.002f, 0.001f, 0.001f, -0.011f, 0.004f, 0.003f, 0.002f, 0.001f, 0.001f };
        if (!up)
        {
            values = Array.ConvertAll(values, f => f * -1);
        }

        string[] keys = { "usLessThanHighschool", "usHighschool",     "usHighschoolGrad",
                          "usTwoYear",            "usBachelors",      "usOther",         "frLessThanHighschool",
                          "frHighschool",         "frHighschoolGrad", "frTwoYear",       "frBachelors", "frOther" };

        MigrationFramework.policyChange(values, keys);
        updateAllData();
        if (up)
        {
            edPolicyLevel++;
        }
        else
        {
            edPolicyLevel--;
        }
        edPolicyText.text = "Level: " + edPolicyLevel;
    }
 public void incrementYear()
 {
     MigrationFramework.yearlyPopUpdate();
     currentYear++;
     updateAllData();
 }
 public void setMigrantsPerYear()
 {
     MigrationFramework.setMigrantsLevels((int)migrantSlider.value);
     sliderText.text = migrantSlider.value.ToString();
 }