MacroCellUrbanAreaChannelRealization::MacroCellUrbanAreaChannelRealization(NetworkNode* src, NetworkNode* dst) { SetSamplingPeriod (0.5); m_penetrationLoss = 10; m_shadowing = 0; m_pathLoss = 0; SetFastFading (new FastFading ()); SetSourceNode (src); SetDestinationNode (dst); #ifdef TEST_PROPAGATION_LOSS_MODEL std::cout << "Created Channe Realization between " << src->GetIDNetworkNode () << " and " << dst->GetIDNetworkNode () << std::endl; #endif if (_simple_jakes_model_) SetChannelType (ChannelRealization::CHANNEL_TYPE_JAKES); if (_PED_A_) SetChannelType (ChannelRealization::CHANNEL_TYPE_PED_A); if (_PED_B_) SetChannelType (ChannelRealization::CHANNEL_TYPE_PED_B); if (_VEH_A_) SetChannelType (ChannelRealization::CHANNEL_TYPE_VEH_A); if (_VEH_B_) SetChannelType (ChannelRealization::CHANNEL_TYPE_VEH_B); UpdateModels (); }
std::vector<double> WinnerDownlinkChannelRealization::GetLoss () { #ifdef TEST_PROPAGATION_LOSS_MODEL std::cout << "\t --> compute loss between " << GetSourceNode ()->GetIDNetworkNode () << " and " << GetDestinationNode ()->GetIDNetworkNode () << std::endl; #endif if (NeedForUpdate ()) { UpdateModels (); } std::vector<double> loss; int now_ms = Simulator::Init()->Now () * 1000; int lastUpdate_ms = GetLastUpdate () * 1000; int index = now_ms - lastUpdate_ms; int nbOfSubChannels = GetSourceNode ()->GetPhy ()->GetBandwidthManager ()->GetDlSubChannels ().size (); for (int i = 0; i < nbOfSubChannels; i++) { //ATTENZIONE double l = GetFastFading ()->at (i).at (index) - GetPathLoss () - GetPenetrationLoss () - GetShadowing (); double l = - GetPathLoss (); loss.push_back (l); #ifdef TEST_PROPAGATION_LOSS_MODEL std::cout << "\t\t mlp = " << GetFastFading ()->at (i).at (index) << " pl = " << GetPathLoss () << " pnl = " << GetPenetrationLoss() << " sh = " << GetShadowing() << " LOSS = " << l << std::endl; #endif } return loss; }
void ModelLoader::Process() { if (m_zoneId == 0) return; if (gGameState != GAMESTATE_INGAME) return; PDOORTABLE pDoorTable = (PDOORTABLE)pSwitchMgr; if (m_loadedDoorCount != pDoorTable->NumEntries && pDoorTable->NumEntries > 0) { UpdateModels(); } DWORD doorTargetId = -1; if (pDoorTarget) doorTargetId = pDoorTarget->ID; if (doorTargetId != m_lastDoorTargetId) { if (m_lastDoorTargetId >= 0) { if (auto model = m_modelData[m_lastDoorTargetId]) { model->SetTargetted(false); } } m_lastDoorTargetId = doorTargetId; m_doorsUI->m_lastDoorTargetId = doorTargetId; if (m_lastDoorTargetId >= 0) { if (auto model = m_modelData[m_lastDoorTargetId]) { model->SetTargetted(true); } } } }
QDbPageActors::QDbPageActors(RPG::Database &database, QWidget *parent) : QWidget(parent), ui(new Ui::QDbPageActors), m_data(database) { ui->setupUi(this); m_currentActor = 0; ui->graphicsBattleset->setScene(new QGraphicsScene(this)); m_charaItem = new QGraphicsCharaItem(); m_charaItem->setSpin(true); m_charaItem->setWalk(true); m_charaItem->setScale(2.0); m_charaItem->setGraphicsEffect(new QGraphicsOpacityEffect(this)); m_faceItem = new QGraphicsFaceItem(); m_faceItem->setScale(2.0); m_battlerItem = new QGraphicsBattleAnimationItem(); for (int i = 0; i < 99; i++) m_dummyCurve.push_back(0); m_hpItem = new QGraphicsCurveItem(Qt::red, m_dummyCurve); m_hpItem->setMaxValue(9999.0); m_mpItem = new QGraphicsCurveItem(Qt::magenta, m_dummyCurve); m_attItem = new QGraphicsCurveItem(Qt::yellow, m_dummyCurve); m_defItem = new QGraphicsCurveItem(Qt::green, m_dummyCurve); m_intItem = new QGraphicsCurveItem(Qt::darkBlue, m_dummyCurve); m_agyItem = new QGraphicsCurveItem(Qt::blue, m_dummyCurve); ui->graphicsCharset->setScene(new QGraphicsScene(this)); ui->graphicsCharset->scene()->addItem(m_charaItem); ui->graphicsCharset->scene()->setSceneRect(0,0,48,64); ui->graphicsFaceset->setScene(new QGraphicsScene(this)); ui->graphicsFaceset->scene()->addItem(m_faceItem); ui->graphicsFaceset->scene()->setSceneRect(0,0,96,96); ui->graphicsBattleset->setScene(new QGraphicsScene(this)); ui->graphicsBattleset->scene()->addItem(m_battlerItem); ui->graphicsBattleset->scene()->setSceneRect(0,0,48,48); ui->graphicsHp->setScene(new QGraphicsScene(this)); ui->graphicsHp->scene()->setSceneRect(QRectF(QPointF(0,0),ui->graphicsHp->size())); ui->graphicsHp->scene()->addItem(m_hpItem); ui->graphicsMp->setScene(new QGraphicsScene(this)); ui->graphicsMp->scene()->setSceneRect(QRectF(QPointF(0,0),ui->graphicsMp->size())); ui->graphicsMp->scene()->addItem(m_mpItem); ui->graphicsAtt->setScene(new QGraphicsScene(this)); ui->graphicsAtt->scene()->setSceneRect(QRectF(QPointF(0,0),ui->graphicsAtt->size())); ui->graphicsAtt->scene()->addItem(m_attItem); ui->graphicsDef->setScene(new QGraphicsScene(this)); ui->graphicsDef->scene()->setSceneRect(QRectF(QPointF(0,0),ui->graphicsDef->size())); ui->graphicsDef->scene()->addItem(m_defItem); ui->graphicsInt->setScene(new QGraphicsScene(this)); ui->graphicsInt->scene()->setSceneRect(QRectF(QPointF(0,0),ui->graphicsInt->size())); ui->graphicsInt->scene()->addItem(m_intItem); ui->graphicsAgy->setScene(new QGraphicsScene(this)); ui->graphicsAgy->scene()->setSceneRect(QRectF(QPointF(0,0),ui->graphicsAgy->size())); ui->graphicsAgy->scene()->addItem(m_agyItem); QTimer *timer = new QTimer(this); connect(timer, SIGNAL(timeout()), ui->graphicsCharset->scene(), SLOT(advance())); connect(timer, SIGNAL(timeout()), ui->graphicsBattleset->scene(), SLOT(advance())); timer->start(200); UpdateModels(); if (ui->listCharacters->count()) ui->listCharacters->setCurrentRow(0); }
/* SetConfParms: set conf parms relevant to HCompV */ void SetConfParms(void) { int i; Boolean b; double f; char buf[MAXSTRLEN]; nParm = GetConfig("HEREST", TRUE, cParm, MAXGLOBS); if (nParm>0) { if (GetConfInt(cParm,nParm,"TRACE",&i)) trace = i; if (GetConfFlt(cParm,nParm,"VARFLOORPERCENTILE",&f)) varFloorPercent = f; if (GetConfBool(cParm,nParm,"SAVEBINARY",&b)) saveBinary = b; if (GetConfBool(cParm,nParm,"BINARYACCFORMAT",&b)) ldBinary = b; /* 2-model reestimation alignment model set */ if (GetConfStr(cParm,nParm,"ALIGNMODELMMF",buf)) { strcpy(al_hmmMMF,buf); al_hmmUsed = TRUE; } if (GetConfStr(cParm,nParm,"ALIGNHMMLIST",buf)) { strcpy(al_hmmLst,buf); al_hmmUsed = TRUE; } /* allow multiple individual model files */ if (GetConfStr(cParm,nParm,"ALIGNMODELDIR",buf)) { strcpy(al_hmmDir,buf); al_hmmUsed = TRUE; } if (GetConfStr(cParm,nParm,"ALIGNMODELEXT",buf)) { strcpy(al_hmmExt,buf); al_hmmUsed = TRUE; } if (GetConfStr(cParm,nParm,"ALIGNXFORMEXT",buf)) { xfInfo.alXFormExt = CopyString(&hmmStack,buf); } if (GetConfStr(cParm,nParm,"ALIGNXFORMDIR",buf)) { xfInfo.alXFormDir = CopyString(&hmmStack,buf); } if (GetConfStr(cParm,nParm,"INXFORMMASK",buf)) { xfInfo.inSpkrPat = CopyString(&hmmStack,buf); } if (GetConfStr(cParm,nParm,"PAXFORMMASK",buf)) { xfInfo.paSpkrPat = CopyString(&hmmStack,buf); } if (GetConfStr(cParm,nParm,"LABFILEMASK",buf)) { labFileMask = (char*)malloc(strlen(buf)+1); strcpy(labFileMask, buf); } if (GetConfStr(cParm,nParm,"UPDATEMODE",buf)) { if (!strcmp (buf, "DUMP")) updateMode = UPMODE_DUMP; else if (!strcmp (buf, "UPDATE")) updateMode = UPMODE_UPDATE; else if (!strcmp (buf, "BOTH")) updateMode = UPMODE_BOTH; else HError(2319, "Unknown UPDATEMODE specified (must be DUMP, UPDATE or BOTH)"); } } } void ReportUsage(void) { printf("\nUSAGE: HERest [options] hmmList dataFiles...\n\n"); printf(" Option Default\n\n"); printf(" -a Use an input linear transform off\n"); printf(" -c f Mixture pruning threshold 10.0\n"); printf(" -d s dir to find hmm definitions current\n"); printf(" -h s set output speaker name pattern *.%%%%%%\n"); printf(" to s, optionally set input and parent patterns\n"); printf(" -l N set max files per speaker off\n"); printf(" -m N set min examples needed per model 3\n"); printf(" -o s extension for new hmm files as src\n"); printf(" -p N set parallel mode to N off\n"); printf(" -r Enable Single Pass Training... \n"); printf(" ...using two parameterisations off\n"); printf(" -s s print statistics to file s off\n"); printf(" -t f [i l] set pruning to f [inc limit] inf\n"); printf(" -u tmvwap update t)rans m)eans v)ars w)ghts tmvw\n"); printf(" a)daptation xform p)rior used \n"); printf(" s)semi-tied xform \n"); printf(" -v f set minimum variance to f 0.0\n"); printf(" -w f set mix weight floor to f*MINMIX 0.0\n"); printf(" -x s extension for hmm files none\n"); printf(" -z s Save all xforms to TMF file s TMF\n"); PrintStdOpts("BEFGHIJKLMSTX"); printf("\n\n"); } void SetuFlags(void) { char *s; s=GetStrArg(); uFlags=(UPDSet) 0; while (*s != '\0') switch (*s++) { case 't': uFlags = (UPDSet) (uFlags+UPTRANS); break; case 'm': uFlags = (UPDSet) (uFlags+UPMEANS); break; case 'v': uFlags = (UPDSet) (uFlags+UPVARS); break; case 'w': uFlags = (UPDSet) (uFlags+UPMIXES); break; case 's': uFlags = (UPDSet) (uFlags+UPSEMIT); break; case 'a': uFlags = (UPDSet) (uFlags+UPXFORM); break; case 'p': uFlags = (UPDSet) (uFlags+UPMAP); break; default: HError(2320,"SetuFlags: Unknown update flag %c",*s); break; } } /* ScriptWord: return next word from script */ char *ScriptWord(FILE *script, char *scriptBuf) { int ch,qch,i; i=0; ch=' '; while (isspace(ch)) ch = fgetc(script); if (ch==EOF) { scriptBuf=NULL; return NULL; } if (ch=='\'' || ch=='"'){ qch = ch; ch = fgetc(script); while (ch != qch && ch != EOF) { scriptBuf[i++] = ch; ch = fgetc(script); } if (ch==EOF) HError(5051,"ScriptWord: Closing quote missing in script file"); } else { do { scriptBuf[i++] = ch; ch = fgetc(script); }while (!isspace(ch) && ch != EOF); } scriptBuf[i] = '\0'; return scriptBuf; } void CheckUpdateSetUp() { AdaptXForm *xf;
int main(int argc, char *argv[]) { Source src; int tmpInt; float tmpFlt; char *accfn, *s; void Initialise(char *hmmListFn); void Interpolate(void); void UpdateModels(void); void MakeWtAccLists(void); void AttachWtAccLists(void); void StatReport(void); if(InitShell(argc,argv,hsmooth_version,hsmooth_vc_id)<SUCCESS) HError(2400,"HSmooth: InitShell failed"); InitMem(); InitLabel(); InitMath(); InitSigP(); InitWave(); InitAudio(); InitVQ(); InitModel(); if(InitParm()<SUCCESS) HError(2400,"HSmooth: InitParm failed"); InitTrain(); InitUtil(); if (!InfoPrinted() && NumArgs() == 0) ReportUsage(); if (NumArgs() == 0) Exit(0); SetConfParms(); CreateHeap(&hmmStack,"HmmStore", MSTAK, 1, 1.0, 50000, 500000); CreateHMMSet(&hset,&hmmStack,TRUE); while (NextArg() == SWITCHARG) { s = GetSwtArg(); if (strlen(s)!=1) HError(2419,"HSmooth: Bad switch %s; must be single letter",s); switch(s[0]){ case 'b': epsilon = GetChkedFlt(0.0,1.0,s); break; case 'c': maxStep = GetChkedInt(1,1000,s); break; case 'd': if (NextArg()!=STRINGARG) HError(2419,"HSmooth: HMM definition directory expected"); hmmDir = GetStrArg(); break; case 'e': if (NextArg()!=STRINGARG) HError(2419,"HSmooth: HMM definition directory expected"); newDir = GetStrArg(); break; case 'm': minEgs = GetChkedInt(1,1000,s); break; case 'o': if (NextArg()!=STRINGARG) HError(2419,"HSmooth: HMM file extension expected"); newExt = GetStrArg(); break; case 's': stats = TRUE; if (NextArg()!=STRINGARG) HError(2419,"HSmooth: Stats file name expected"); statFN = GetStrArg(); break; case 'u': SetuFlags(); break; case 'v': minVar = GetChkedFlt(0.0,10.0,s); break; case 'w': mixWeightFloor = MINMIX * GetChkedFlt(0.0,10000.0,s); break; case 'x': if (NextArg()!=STRINGARG) HError(2419,"HSmooth: HMM file extension expected"); hmmExt = GetStrArg(); break; case 'B': saveBinary=TRUE; break; case 'H': if (NextArg() != STRINGARG) HError(2419,"HSmooth: HMM macro file name expected"); AddMMF(&hset,GetStrArg()); break; case 'M': if (NextArg()!=STRINGARG) HError(2419,"HSmooth: Output macro file directory expected"); newDir = GetStrArg(); break; case 'T': trace = GetChkedInt(0,0100000,s); break; default: HError(2419,"HSmooth: Unknown switch %s",s); } } if (NextArg() != STRINGARG) HError(2419,"HSmooth: file name of HMM list expected"); Initialise(GetStrArg()); do { if (NextArg()!=STRINGARG) HError(2419,"HSmooth: accumulator file name expected"); accfn = GetStrArg(); src=LoadAccs(&hset,accfn,uFlags); ReadFloat(&src,&tmpFlt,1,ldBinary); totalPr += (LogDouble)tmpFlt; ReadInt(&src,&tmpInt,1,ldBinary); totalT += tmpInt; CloseSource(&src); nBlk++; MakeWtAccLists(); } while (NumArgs()>0); AttachWtAccLists(); Interpolate(); if (stats) StatReport(); UpdateModels(); Exit(0); return (0); /* never reached -- make compiler happy */ }