public static void SendPotentialCustomer(Spa s) { Customer n; int limit = (int)(Math.Log(population) * 0.7 * s.service_capacity / Math.Log(s.GetAvgServicePrice())) + 1; for (int i = 0; i < limit + rand.Next(0, limit / 5); i++) { n = new Customer(); n.BuyService(s); customers_income++; } period++; }
public void BuyService(Spa s) { s.RenderService(Environment.rand.Next(0, s.service_count)); }
private void button1_Click(object sender, EventArgs e) { message.Text = ""; Environment.Reset((int)population.Value, (double)base_cost.Value, (double)base_salary.Value, (int)eq_state.Value); spa = new Spa((int)start_square.Value, (int)start_service.Value, (int)start_staff.Value, (int)start_equipment.Value); month = 1; clients.ChartAreas[0].AxisX.Minimum = 0; clients.ChartAreas[0].AxisX.Maximum = 12; qual_capacity.ChartAreas[0].AxisX.Minimum = 0; qual_capacity.ChartAreas[0].AxisX.Maximum = 12; cost_price.ChartAreas[0].AxisX.Minimum = 0; cost_price.ChartAreas[0].AxisX.Maximum = 12; staff_equip.ChartAreas[0].AxisX.Minimum = 0; staff_equip.ChartAreas[0].AxisX.Maximum = 12; profit_chart.ChartAreas[0].AxisX.Minimum = 0; profit_chart.ChartAreas[0].AxisX.Maximum = 12; period.Text = Environment.period.ToString(); clients_income.Text = Environment.customers_income.ToString(); served.Text = spa.served.ToString(); quality.Text = spa.service_quality.ToString(); capacity.Text = spa.service_capacity.ToString(); capacity.Text = spa.service_capacity.ToString(); cost.Text = Service.cost.ToString(); equipment.Text = spa.equipment.Count.ToString(); staff.Text = spa.staff.Count.ToString(); clients.Series.Clear(); clients.Series.Add("income"); clients.Series.Add("served"); clients.Series[0].Points.AddXY(month, Environment.customers_income); clients.Series[1].Points.AddXY(month, spa.served); qual_capacity.Series.Clear(); qual_capacity.Series.Add("quality"); qual_capacity.Series.Add("capacity"); qual_capacity.Series[0].Points.AddXY(month, spa.service_quality); qual_capacity.Series[1].Points.AddXY(month, spa.service_capacity); cost_price.Series.Clear(); cost_price.Series.Add("cost"); cost_price.Series.Add("price"); cost_price.Series[0].Points.AddXY(month, Service.cost); cost_price.Series[1].Points.AddXY(month, spa.GetAvgServicePrice()); staff_equip.Series.Clear(); staff_equip.Series.Add("staff"); staff_equip.Series.Add("equipment"); staff_equip.Series[0].Points.AddXY(month, spa.staff.Count); staff_equip.Series[1].Points.AddXY(month, spa.equipment.Count); profit_chart.Series[0].Points.Clear(); profit_chart.Series[0].Points.AddXY(month, spa.profit); profit_month.Series[0].Points.Clear(); timer1.Enabled = true; pause.Enabled = true; skip_month.Enabled = true; }