Разработка имитационной модели организации работы маршрутных микроавтобусов

Терминологическая база для построения модели, имитирующей работу маршрутных микроавтобусов. Обоснование выбора программного средства. Алгоритм работы имитационной модели, особенности ее функционирования. Анализ результатов работы имитационной модели.

Рубрика Программирование, компьютеры и кибернетика
Вид курсовая работа
Язык русский
Дата добавления 29.04.2014
Размер файла 1,1 M

Отправить свою хорошую работу в базу знаний просто. Используйте форму, расположенную ниже

Студенты, аспиранты, молодые ученые, использующие базу знаний в своей учебе и работе, будут вам очень благодарны.

{ avtopark. SetT (i, avtopark. GetT (i) + 1); avtoch++; }

}

}

}

// обработка проезда

if (avtopark. GetT (i) == 0)

{

if ( (avtopark. GetK (i) == 0) && (time >= Convert. ToDateTime ("02.05.2014 00: 00: 00")))

oborot += avtopark. Exit (i);

else

{ // на остановке

oborot += avtopark. Out (i);

if (avtopark. free (i) > ost. Kolvo [avtopark. GetK (i)])

switch (avtopark. wait [i])

{

case - 1: { avtopark. SetT (i, r. Next (1,3)); avtopark. wait [i] = 0; } break; // ожидание на остановке

case 0:

{

ost. Kolvo [avtopark. GetK (i)] = avtopark. In (i, ost. Kolvo [i]);

avtopark. km [i] ++;

if (avtopark. GetK (i)! = ost. Kolvo. GetLength (0) - 1)

avtopark. SetK (i, avtopark. GetK (i) + 1);

else

avtopark. SetK (i, 0);

avtopark. SetT (i, Convert. ToInt32 (textBox3. Text));

avtopark. wait [i] = - 1;

} break;

}

else

{

ost. Kolvo [avtopark. GetK (i)] = avtopark. In (i, ost. Kolvo [i]);

avtopark. km [i] ++;

if (avtopark. GetK (i)! = ost. Kolvo. GetLength (0) - 1)

avtopark. SetK (i, avtopark. GetK (i) + 1);

else

avtopark. SetK (i, 0);

avtopark. SetT (i, Convert. ToInt32 (textBox3. Text));

avtopark. wait [i] = - 1;

}

}

}

}

}

else

{

OnOff (true);

button1. Enabled = false;

timer1. Enabled = false;

button2. Enabled = true;

label8. Text = Convert. ToString (oborot*Convert. ToInt32 (textBox5. Text));

label27. Text = Convert. ToString (avtoch);

comboBox1. DroppedDown = false;

comboBox1. Items. Clear ();

mbit = new Bitmap (pictureBox1. Width, pictureBox1. Height);

gr = Graphics. FromImage (mbit);

Pen MyPen = new Pen (Color. Lime);

gr. FillRectangle (Brushes. Black, 0, 0, pictureBox1. Width, pictureBox1. Height);

gr. DrawLine (MyPen, 20, 185, 20, 1); gr. DrawLine (MyPen, 21, 185, 21, 1);

gr. DrawLine (MyPen, 20, 185, 310, 185); gr. DrawLine (MyPen, 20, 184, 310, 184);

for (int i = 0; i < 16; i++)

gr. DrawString (Convert. ToString (i + 8), new Font ("Arial",

8), new SolidBrush (Color. Lime), 24 + i * 17, 186);

gr. DrawString (Convert. ToString (0), new Font ("Arial",

8), new SolidBrush (Color. Lime), 24 + 16 * 17, 186);

for (int i = 0; i < 17; i++)

gr. DrawLine (MyPen, 31 + i * 17, 185, 31 + i * 17, 1);

for (int i = 1; i < 17; i++)

gr. DrawLine (MyPen, 31 + (i - 1) * 17, - Convert. ToInt32 (165 * (GrIncome [i - 1] / GrIncome. Max ())) + 20 + 165, 31 + i * 17, - Convert. ToInt32 (165 * (GrIncome [i] / GrIncome. Max ())) + 20 + 165);

pictureBox1. Image = mbit;

mbit = new Bitmap (pictureBox2. Width, pictureBox2. Height);

gr = Graphics. FromImage (mbit);

gr. FillRectangle (Brushes. Black, 0, 0, pictureBox2. Width, pictureBox2. Height);

gr. DrawLine (MyPen, 20, 185, 20, 1); gr. DrawLine (MyPen, 21, 185, 21, 1);

gr. DrawLine (MyPen, 20, 185, 310, 185); gr. DrawLine (MyPen, 20, 184, 310, 184);

for (int i = 0; i < 16; i++)

gr. DrawString (Convert. ToString (i + 8), new Font ("Arial",

8), new SolidBrush (Color. Lime), 24 + i * 17, 186);

gr. DrawString (Convert. ToString (0), new Font ("Arial",

8), new SolidBrush (Color. Lime), 24 + 16 * 17, 186);

for (int i = 0; i < 17; i++)

gr. DrawLine (MyPen, 31 + i * 17, 185, 31 + i * 17, 1);

MyPen. Color = Color. Red;

for (int i = 1; i < 17; i++)

gr. DrawLine (MyPen, 31 + (i - 1) * 17, - Convert. ToInt32 (165 * (GrPas [i - 1] / maxi (GrPas. Max (), GrGetedPas. Max ()))) + 20 + 165, 31 + i * 17, - Convert. ToInt32 (165 * (GrPas [i] / maxi (GrPas. Max (), GrGetedPas. Max ()))) + 20 + 165);

MyPen. Color = Color. Yellow;

for (int i = 1; i < 17; i++)

gr. DrawLine (MyPen, 31 + (i - 1) * 17, - Convert. ToInt32 (165 * (GrGetedPas [i - 1] / maxi (GrPas. Max (), GrGetedPas. Max ()))) + 20 + 165, 31 + i * 17, - Convert. ToInt32 (165 * (GrGetedPas [i] / maxi (GrPas. Max (), GrGetedPas. Max ()))) + 20 + 165);

pictureBox2. Image = mbit;

}

// графики

if ( (time. Minute == 0) && (time <= Convert. ToDateTime ("02.05.2014 00: 00: 00")))

{

int k=time. Hour - 8;

if (k < 0) k = 16;

GrPas [k] = pas;

GrIncome [k] = (oborot-oborothour) *Convert. ToInt32 (textBox5. Text);

GrGetedPas [k] = svobodnihmest;

oborothour = oborot;

pas = 0;

svobodnihmest = 0;

}

for (int i = 0; i < ost. n; i++)

pas+=ost. Kolvo [i];

for (int i = 0; i < avtopark. matr. GetLength (0); i++)

svobodnihmest += avtopark. free (i);

if (time == Convert. ToDateTime ("02.05.2014 00: 00: 00"))

label36. Text = Convert. ToString (oborot) + "/" + Convert. ToString (ost. kol);

avtopark. Tic ();

ost. Tic (time. Hour - 8);

time = time. AddMinutes (1);

label5. Text = Convert. ToString (time). Remove (0,11);

progressBar1. PerformStep ();

if (button1. Text == "Продолжить")

timer1. Enabled = false;

}

private void textBox3_TextChanged (object sender, EventArgs e)

{

string s = "";

for (int i = 0; i < textBox3. TextLength; i++)

if ( (textBox3. Text [i] <= '9') && (textBox3. Text [i] >= '0'))

s = s + textBox3. Text [i];

textBox3. Text = s;

}

private void textBox2_TextChanged (object sender, EventArgs e)

{

string s = "";

for (int i = 0; i < textBox2. TextLength; i++)

if ( (textBox2. Text [i] <= '9') && (textBox2. Text [i] >= '0'))

s = s + textBox2. Text [i];

textBox2. Text = s;

}

private void textBox1_TextChanged (object sender, EventArgs e)

{

string s = "";

for (int i = 0; i < textBox1. TextLength; i++)

if ( (textBox1. Text [i] <= '9') && (textBox1. Text [i] >= '0'))

s = s + textBox1. Text [i];

textBox1. Text = s;

}

private void textBox4_TextChanged (object sender, EventArgs e)

{

string s = "";

for (int i = 0; i < textBox4. TextLength; i++)

if ( (textBox4. Text [i] <= '9') && (textBox4. Text [i] >= '0'))

s = s + textBox4. Text [i];

textBox4. Text = s;

}

private void textBox6_TextChanged (object sender, EventArgs e)

{

string s = "";

for (int i = 0; i < textBox6. TextLength; i++)

if ( (textBox6. Text [i] <= '9') && (textBox6. Text [i] >= '0'))

s = s + textBox6. Text [i];

textBox6. Text = s;

}

private void OnOff (bool b)

{

textBox1. Enabled = b; textBox2. Enabled = b; textBox3. Enabled = b; textBox4. Enabled = b; textBox5. Enabled = b; textBox6. Enabled = b;

textBox7. Enabled = b; textBox8. Enabled = b; textBox9. Enabled = b; textBox10. Enabled = b; textBox11. Enabled = b; textBox12. Enabled = b;

textBox13. Enabled = b; textBox14. Enabled = b; textBox15. Enabled = b; textBox16. Enabled = b; textBox17. Enabled = b; textBox18. Enabled = b;

textBox19. Enabled = b; textBox20. Enabled = b; textBox21. Enabled = b; textBox22. Enabled = b;

}

private void button2_Click (object sender, EventArgs e)

{

OnOff (false);

time = Convert. ToDateTime ("01.05.2014 08: 00: 00");

progressBar1. Value = 0;

oborot = 0; avtoch = 0; pas = 0; oborothour = 0; svobodnihmest = 0; kolvopas = 0;

avtopark = new avtobus (Convert. ToInt32 (textBox1. Text), Convert. ToInt32 (textBox2. Text));

GrGetedPas=new double [17];

GrIncome=new double [17];

GrPas = new double [17];

GrIncome [0] = 0;

GrPas [0] = 0;

GrGetedPas [0] = 0;

for (int i = 0; i < Convert. ToInt32 (textBox1. Text); i++)

comboBox1. Items. Add (i);

comboBox1. SelectedIndex = 0;

avtopark. FirstAvto (Convert. ToInt32 (textBox4. Text));

ost = new ostanovk (Convert. ToInt32 (textBox6. Text) * 2);

ost. HourRange [0] = Convert. ToInt32 (textBox7. Text);

ost. HourRange [1] = Convert. ToInt32 (textBox8. Text);

ost. HourRange [2] = Convert. ToInt32 (textBox9. Text);

ost. HourRange [3] = Convert. ToInt32 (textBox10. Text);

ost. HourRange [4] = Convert. ToInt32 (textBox11. Text);

ost. HourRange [5] = Convert. ToInt32 (textBox12. Text);

ost. HourRange [6] = Convert. ToInt32 (textBox13. Text);

ost. HourRange [7] = Convert. ToInt32 (textBox14. Text);

ost. HourRange [8] = Convert. ToInt32 (textBox15. Text);

ost. HourRange [9] = Convert. ToInt32 (textBox16. Text);

ost. HourRange [10] = Convert. ToInt32 (textBox17. Text);

ost. HourRange [11] = Convert. ToInt32 (textBox18. Text);

ost. HourRange [12] = Convert. ToInt32 (textBox19. Text);

ost. HourRange [13] = Convert. ToInt32 (textBox20. Text);

ost. HourRange [14] = Convert. ToInt32 (textBox21. Text);

ost. HourRange [15] = Convert. ToInt32 (textBox22. Text);

timer1. Enabled = true;

button2. Enabled = false;

button1. Enabled = true;

button4. Enabled = false;

}

private void button1_Click (object sender, EventArgs e)

{

timer1. Enabled =! timer1. Enabled;

if (timer1. Enabled == true)

{button1. Text = "Пауза"; button4. Enabled = false; }

else

{ button1. Text = "Продолжить"; button4. Enabled = true; }

}

private void comboBox1_SelectedIndexChanged (object sender, EventArgs e)

{

if (button1. Enabled==true)

{

label28. Text = Convert. ToString (avtopark. GetK (comboBox1. SelectedIndex));

label29. Text = Convert. ToString (avtopark. free (comboBox1. SelectedIndex));

label33. Text = Convert. ToString (avtopark. km [comboBox1. SelectedIndex]);

}

}

private void button3_Click (object sender, EventArgs e)

{

}

private void button3_Click_1 (object sender, EventArgs e)

{

if ( (button1. Enabled == true) && (time. Hour>8))

{

OnOff (true);

button4. Enabled = false;

button1. Enabled = false;

button1. Text = "Пауза";

timer1. Enabled = false;

button2. Enabled = true;

label8. Text = Convert. ToString (oborot * Convert. ToInt32 (textBox5. Text));

label27. Text = Convert. ToString (avtoch);

comboBox1. DroppedDown = false;

comboBox1. Items. Clear ();

mbit = new Bitmap (pictureBox1. Width, pictureBox1. Height);

gr = Graphics. FromImage (mbit);

Pen MyPen = new Pen (Color. Lime);

gr. FillRectangle (Brushes. Black, 0, 0, pictureBox1. Width, pictureBox1. Height);

gr. DrawLine (MyPen, 20, 185, 20, 1); gr. DrawLine (MyPen, 21, 185, 21, 1);

gr. DrawLine (MyPen, 20, 185, 310, 185); gr. DrawLine (MyPen, 20, 184, 310, 184);

for (int i = 0; i < 16; i++)

gr. DrawString (Convert. ToString (i + 8), new Font ("Arial",

8), new SolidBrush (Color. Lime), 24 + i * 17, 186);

gr. DrawString (Convert. ToString (0), new Font ("Arial",

8), new SolidBrush (Color. Lime), 24 + 16 * 17, 186);

for (int i = 0; i < 17; i++)

gr. DrawLine (MyPen, 31 + i * 17, 185, 31 + i * 17, 1);

for (int i = 1; i < 17; i++)

gr. DrawLine (MyPen, 31 + (i - 1) * 17, - Convert. ToInt32 (165 * (GrIncome [i - 1] / GrIncome. Max ())) + 20 + 165, 31 + i * 17, - Convert. ToInt32 (165 * (GrIncome [i] / GrIncome. Max ())) + 20 + 165);

pictureBox1. Image = mbit;

mbit = new Bitmap (pictureBox2. Width, pictureBox2. Height);

gr = Graphics. FromImage (mbit);

gr. FillRectangle (Brushes. Black, 0, 0, pictureBox2. Width, pictureBox2. Height);

gr. DrawLine (MyPen, 20, 185, 20, 1); gr. DrawLine (MyPen, 21, 185, 21, 1);

gr. DrawLine (MyPen, 20, 185, 310, 185); gr. DrawLine (MyPen, 20, 184, 310, 184);

for (int i = 0; i < 16; i++)

gr. DrawString (Convert. ToString (i + 8), new Font ("Arial",

8), new SolidBrush (Color. Lime), 24 + i * 17, 186);

gr. DrawString (Convert. ToString (0), new Font ("Arial",

8), new SolidBrush (Color. Lime), 24 + 16 * 17, 186);

for (int i = 0; i < 17; i++)

gr. DrawLine (MyPen, 31 + i * 17, 185, 31 + i * 17, 1);

MyPen. Color = Color. Red;

for (int i = 1; i < 17; i++)

gr. DrawLine (MyPen, 31 + (i - 1) * 17, - Convert. ToInt32 (165 * (GrPas [i - 1] / GrPas. Max ())) + 20 + 165, 31 + i * 17, - Convert. ToInt32 (165 * (GrPas [i] / GrPas. Max ())) + 20 + 165);

MyPen. Color = Color. Yellow;

for (int i = 1; i < 17; i++)

gr. DrawLine (MyPen, 31 + (i - 1) * 17, - Convert. ToInt32 (165 * (GrGetedPas [i - 1] / GrGetedPas. Max ())) + 20 + 165, 31 + i * 17, - Convert. ToInt32 (165 * (GrGetedPas [i] / GrGetedPas. Max ())) + 20 + 165);

pictureBox2. Image = mbit;

}

}

private void button4_Click (object sender, EventArgs e)

{

timer1. Enabled = true;

}

}

}

Размещено на Allbest.ru


Подобные документы

  • Процесс моделирования имитационной модели функционирования класса персональных компьютеров на языке GPSS World. Поиск линейной зависимости и оценка полученного уравнения. Отчет по результатам работы имитационной модели. Листинг разработанной программы.

    курсовая работа [49,2 K], добавлен 07.09.2012

  • Специфика работы терапевтического отделения. Разработка имитационной модели в среде AnyLogic. Выбор средств моделирования. Описание схемы моделирующего алгоритма. Организация вычислительного эксперимента над математической моделью, анализ его результатов.

    курсовая работа [1,2 M], добавлен 10.06.2015

  • Направления деятельности ООО "Тирион" и разработка модели "AS-IS" функционирования магазина по обслуживанию покупателей. Возможности табличного процессора MS Excel. Описание интерфейса и физической структуры программного обеспечения имитационной модели.

    курсовая работа [990,6 K], добавлен 13.12.2011

  • Практические навыки системного исследования реальной динамической сложной системы на основе построения ее имитационной модели. Автоматизация работы по расчету эффективности системы массового обслуживания с понятным интерфейсом. Выбор алгоритма решения.

    курсовая работа [1,0 M], добавлен 18.08.2009

  • Разработка имитационной модели "Перекресток" для анализа бизнес-процессов предприятия и принятия решения в сложных условиях. Алгоритм построения имитационной модели на основе CASE-средств. Обзор программного обеспечения для имитационного моделирования.

    дипломная работа [2,6 M], добавлен 22.11.2015

  • Анализ и формализация задачи моделирования: построение концептуальной модели, ее формализация в виде Q-схемы. Построение имитационной модели: создание блок-схемы, представление базовой исходной имитационной модели. Исследование экономических процессов.

    контрольная работа [156,0 K], добавлен 21.11.2010

  • Обеспечение правильной работы и обслуживания сети посредством разработки и исследования имитационной модели локальной вычислительной сети. Анализ основных проблем: организационная структура, расположение, испытание, проверка сети и экономическая выгода.

    дипломная работа [606,9 K], добавлен 14.10.2010

  • Характеристика практической разработки имитационной модели при помощи инструментального прикладного программного продукта (ППП) Visual Imitak. Анализ этапов деятельности складского хозяйства с использованием основных блоков моделирования и функции quant.

    отчет по практике [1,2 M], добавлен 29.05.2014

  • Общая характеристика ателье "Вита", схема модели рабочего процесса. Исследование заданной системы с помощью моделирования динамических рядов, модели типа "система массового облуживания". Построение имитационной модели деятельности данного ателье.

    курсовая работа [1,4 M], добавлен 01.06.2016

  • Создание математической модели системы массового обслуживания на примере банка. Разработка имитационной модели на языке программирования С++. Блок-схема программы, перевод модели на язык программирования. Верификация и валидация имитационной модели.

    курсовая работа [630,5 K], добавлен 01.06.2015

Работы в архивах красиво оформлены согласно требованиям ВУЗов и содержат рисунки, диаграммы, формулы и т.д.
PPT, PPTX и PDF-файлы представлены только в архивах.
Рекомендуем скачать работу.