本文整理汇总了C++中LinkGraphJob::Cargo方法的典型用法代码示例。如果您正苦于以下问题:C++ LinkGraphJob::Cargo方法的具体用法?C++ LinkGraphJob::Cargo怎么用?C++ LinkGraphJob::Cargo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LinkGraphJob
的用法示例。
在下文中一共展示了LinkGraphJob::Cargo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TileXY
/**
* Create the DemandCalculator and immediately do the calculation.
* @param job Job to calculate the demands for.
*/
DemandCalculator::DemandCalculator(LinkGraphJob &job) :
max_distance(DistanceMaxPlusManhattan(TileXY(0,0), TileXY(MapMaxX(), MapMaxY())))
{
const LinkGraphSettings &settings = job.Settings();
CargoID cargo = job.Cargo();
this->accuracy = settings.accuracy;
this->mod_dist = settings.demand_distance;
if (this->mod_dist > 100) {
/* Increase effect of mod_dist > 100 */
int over100 = this->mod_dist - 100;
this->mod_dist = 100 + over100 * over100;
}
switch (settings.GetDistributionType(cargo)) {
case DT_SYMMETRIC:
this->CalcDemand<SymmetricScaler>(job, SymmetricScaler(settings.demand_size));
break;
case DT_ASYMMETRIC:
this->CalcDemand<AsymmetricScaler>(job, AsymmetricScaler());
break;
default:
/* Nothing to do. */
break;
}
}