本文整理汇总了C++中Population::dissolve_partnerDeficit_fct方法的典型用法代码示例。如果您正苦于以下问题:C++ Population::dissolve_partnerDeficit_fct方法的具体用法?C++ Population::dissolve_partnerDeficit_fct怎么用?C++ Population::dissolve_partnerDeficit_fct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Population
的用法示例。
在下文中一共展示了Population::dissolve_partnerDeficit_fct方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CODECHECK_partnerships
//.........这里部分代码省略.........
for (int i=0; i<agef.size(); i++)
{
for (int j=0; j<agegap.size(); j++)
{
agef_.push_back(agef[i]);
agegap_.push_back(agegap[j]);
double s = expGauss(agef[i],P.get_spousalProgress_meanAge_f(), P.get_spousalProgress_varAge_f())
*expGauss(agegap_[j],P.get_spousalProgress_meanGap(), P.get_spousalProgress_varGap());
sp_age.push_back(s);
}
}
dcMatrix Msp_age(agef_);
Msp_age.addColVector(agegap_);
Msp_age.addColVector(sp_age);
Msp_age.WriteToFileCSV(_DIR_VIZINPUT + "viz_input_prtnr_sp_age.out");
// --- Dissolution: age
vector<double> dage;
vector<double> age_1;
vector<double> age_2;
for (int i=0; i<age.size(); i++) {
for (int j=0; j<age.size(); j++)
{
age_1.push_back(age[i]);
age_2.push_back(age[j]);
dage.push_back(P.dissolve_age_fct(age[i],age[j]));
}
}
dcMatrix Dage(age_1);
Dage.addColVector(age_2);
Dage.addColVector(dage);
Dage.WriteToFileCSV(_DIR_VIZINPUT + "viz_input_prtnr_dissol_age.out");
// --- Dissolution: risk group
r1.clear();
r2.clear();
vector<double> drisk;
for (int i=0; i<=rmx; i++)
{
for (int j=0; j<=rmx; j++)
{
r1.push_back(i);
r2.push_back(j);
drisk.push_back(P.dissolve_riskGroup_fct(i, j));
}
}
dcMatrix Dfrisk(r1);
Dfrisk.addColVector(r2);
Dfrisk.addColVector(drisk);
Dfrisk.WriteToFileCSV(_DIR_VIZINPUT + "viz_input_prtnr_dissol_risk.out");
// --- Dissolution: partnership duration
vector<double> pdur = vector_seq(0.0,70.0, 200);
vector<double> ddur(age.size());
for (int i=0; i<pdur.size(); i++) {
ddur[i] = P.dissolve_duration_fct(pdur[i]);
}
dcMatrix Dpdur(pdur);
Dpdur.addColVector(ddur);
Dpdur.WriteToFileCSV(_DIR_VIZINPUT + "viz_input_prtnr_dissol_pduration.out");
// --- Dissolution: deficit
vector<double> ddeficit;
xx1.clear();
xx2.clear();
for (int i=0; i<x1.size(); i++)
{
for (int j=0; j<x2.size(); j++)
{
xx1.push_back(x1[i]);
xx2.push_back(x2[j]);
ddeficit.push_back(P.dissolve_partnerDeficit_fct(x1[i], x2[j]));
}
}
dcMatrix Ddeficit(xx1);
Ddeficit.addColVector(xx2);
Ddeficit.addColVector(ddeficit);
Ddeficit.WriteToFileCSV(_DIR_VIZINPUT + "viz_input_prtnr_dissol_deficit.out");
}