本文整理汇总了C++中CField::GetPercentOfPedestrianCrossing方法的典型用法代码示例。如果您正苦于以下问题:C++ CField::GetPercentOfPedestrianCrossing方法的具体用法?C++ CField::GetPercentOfPedestrianCrossing怎么用?C++ CField::GetPercentOfPedestrianCrossing使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CField
的用法示例。
在下文中一共展示了CField::GetPercentOfPedestrianCrossing方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessModel
void CNature::ProcessModel(CView *pEngine)
{
CField *pField = static_cast<CTrafficLightDoc *>(pEngine->GetDocument())->GetField();
m_pOptimalTLight->SetNumbersOfLines(pField->GetNCarLines(), pField->GetNHumanLines());
CCarStreamDisctrib *pCarDistrib = new CCarStreamDisctrib();
Days day = Monday;
int time = 0;
Weather weather = Sunny;
TrafficLightType TLightType = Smart;
int roadLen1 = pField->GetXMax()*(1-pField->GetPercentOfPedestrianCrossing());
int roadLen2 = pField->GetYMax()*(1-pField->GetPercentOfCarRoad());
m_pOptimalTLight->TeachYourSelf(m_SpeedHumanAppearance, m_SpeedCarAppearance, roadLen1, roadLen2);
while (true)
{
if (m_Paused)
{
while (m_Paused)
{
Sleep(100);
};
pField->DeleteAllMO();
if (pInfoPanel != NULL)
{
int Hours;
int Minutes;
day = pInfoPanel->GetDay();
pInfoPanel->GetTime(Hours, Minutes);
GetTicsByTime(Hours, Minutes, time);
weather = pInfoPanel->GetWeather();
TLightType = pInfoPanel->GetTrafficLightType();
}
else
{
day = Monday;
time = 0;
weather = Sunny;
TLightType = Smart;
};
};
for (; (day <= Sunday)&&(!m_Paused); day = static_cast<Days>(static_cast<int>(day) + 1))
{
float RedTime;
float GreenTime;
float YellowTime;
int Counter;
for (; (time < m_CyclesPerDay)&&(!m_Paused); time++, Counter++)
{
Times TypeOfTime;
int Hours;
int Minutes;
GetTimeByTics(time, Hours, Minutes);
if ((Hours>=6)&&(Hours < 8))
{
TypeOfTime = EarlyMorning;
}
else
{
if ((Hours>=8)&&(Hours<11))
{
TypeOfTime = Morning;
}
else
{
if ((Hours>=11)&&(Hours<16))
{
TypeOfTime = Afternoon;
}
else
{
if ((Hours>=16)&&(Hours<21))
{
TypeOfTime = Everning;
}
else
{
TypeOfTime = Night;
};
};
};
};
//Generate weather (obsolete, now it is setted by GUI)
//if (time % (m_CyclesPerDay/5) == 0)
//{
// weather = static_cast<Weather>(rand() % 3);
//};
int day1 = ((day!=Saturday)&&(day!=Sunday))?(Workday):(Holiday);
//.........这里部分代码省略.........