SUMOReal MSPModel_NonInteracting::PState::getAngle(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const { //std::cout << SIMTIME << " rawAngle=" << stage.getEdgeAngle(stage.getEdge(), getEdgePos(stage, now)) << " angle=" << stage.getEdgeAngle(stage.getEdge(), getEdgePos(stage, now)) + (myCurrentEndPos < myCurrentBeginPos ? 180 : 0) << "\n"; SUMOReal angle = stage.getEdgeAngle(stage.getEdge(), getEdgePos(stage, now)) + (myCurrentEndPos < myCurrentBeginPos ? M_PI : 0); if (angle > M_PI) { angle -= 2 * M_PI; } return angle; }
Graph* createTopNGraphs(int bucketsNumber,int bucketSize ,Graph *graph,Forum** _forum){ Graph* gforum; Graph* current=NULL,*prev; Graph* g; void* returnG; int i; int err; gforum = findGraph(graph,"forum"); int position = getEdgePos(gforum,"hasMember_person"); Node* node; Node *n; pthread_t creator[NUMBER_OF_TOP_N_FORUMS]; //Gia kathe topN forum xrhsimopoioume ena thread create_args args[NUMBER_OF_TOP_N_FORUMS]; for (i=0;i<NUMBER_OF_TOP_N_FORUMS;i++){ args[i].gforum = gforum; args[i].g = graph; args[i].forum = _forum[i]; if ( (err = pthread_create(&creator[i], 0, createForum, (void*)&args[i]))>0){ perror2("pthread_create",err); } } for (i=0;i<NUMBER_OF_TOP_N_FORUMS;i++){ //Anamonh na ftiaxtoun oi grafoi gia na tous sundesoume sthn lista grafwn if ( (err = pthread_join(creator[i],&returnG))>0){ perror2("pthread_join",err); } prev = current; current = (Graph*) returnG; if (i==0){ g = current; } else{ prev->next = current; } } return g; }
Position MSPModel_NonInteracting::PState::getPosition(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const { const MSLane* lane = getSidewalk<MSEdge, MSLane>(stage.getEdge()); const SUMOReal lateral_offset = lane->allowsVehicleClass(SVC_PEDESTRIAN) ? 0 : SIDEWALK_OFFSET; return stage.getLanePosition(lane, getEdgePos(stage, now), lateral_offset); }