Changeset 726 for cpp/frams/genetics/f4/conv_f4.cpp
- Timestamp:
- 01/19/18 19:37:43 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/genetics/f4/conv_f4.cpp
r675 r726 178 178 // new part object for firstend 179 179 // coordinates are left to be computed by Model 180 sprintf(tmpLine, " p:fr=%g,ing=%g,as=%g",180 sprintf(tmpLine, "fr=%g,ing=%g,as=%g", 181 181 /*1.0/C->P.mass,*/ C->P.friction, C->P.ingestion, C->P.assimilation 182 182 //C->firstend.x, C->firstend.y, C->firstend.z 183 183 ); 184 partidx = singleStepBuild(tmpLine, &range);184 partidx = addFromString(PartType, tmpLine, &range); 185 185 if (partidx < 0) return -1; 186 186 jj_p1_refno = partidx; … … 194 194 } 195 195 // new part object for lastend 196 sprintf(tmpLine, " p:fr=%g,ing=%g,as=%g",196 sprintf(tmpLine, "fr=%g,ing=%g,as=%g", 197 197 //C->lastend.x, C->lastend.y, C->lastend.z 198 198 /*"vol=" 1.0/C->P.mass,*/ C->P.friction, C->P.ingestion, C->P.assimilation 199 199 ); 200 partidx = singleStepBuild(tmpLine, &range);200 partidx = addFromString(PartType, tmpLine, &range); 201 201 if (partidx < 0) return -2; 202 202 C->p2_refno = partidx; … … 207 207 if ((jj_p1_refno < 0) || (jj_p1_refno >= getPartCount())) return -11; 208 208 if ((jj_p2_refno < 0) || (jj_p2_refno >= getPartCount())) return -12; 209 sprintf(tmpLine, " j:p1=%ld,p2=%ld,dx=%g,dy=0,dz=0,rx=%g,ry=0,rz=%g"\209 sprintf(tmpLine, "p1=%ld,p2=%ld,dx=%g,dy=0,dz=0,rx=%g,ry=0,rz=%g"\ 210 210 ",stam=%g", 211 211 jj_p1_refno, jj_p2_refno, … … 218 218 C->P.stamina 219 219 ); 220 partidx = singleStepBuild(tmpLine, &range);220 partidx = addFromString(JointType, tmpLine, &range); 221 221 if (partidx < 0) return -13; 222 222 C->joint_refno = partidx; … … 230 230 if ((p_refno < 0) || (p_refno >= getPartCount())) return -21; 231 231 // joint_refno is currently not used 232 sprintf(tmpLine, " n:p=%ld,d=\"N:in=%g,fo=%g,si=%g\"",232 sprintf(tmpLine, "p=%ld,d=\"N:in=%g,fo=%g,si=%g\"", 233 233 p_refno, 234 234 C->inertia, C->force, C->sigmo); 235 partidx = singleStepBuild(tmpLine, &range);235 partidx = addFromString(NeuronType, tmpLine, &range); 236 236 if (partidx < 0) return -22; 237 237 C->neuro_refno = partidx; … … 241 241 { 242 242 if (1 == C->ctrl) 243 sprintf(tmpLine, " n:j=%d,d=\"@:p=%g\"", C->dadlink->joint_refno, C->P.muscle_power);243 sprintf(tmpLine, "j=%d,d=\"@:p=%g\"", C->dadlink->joint_refno, C->P.muscle_power); 244 244 else 245 sprintf(tmpLine, " n:j=%d,d=\"|:p=%g,r=%g\"", C->dadlink->joint_refno, C->P.muscle_power, C->mz);246 partidx = singleStepBuild(tmpLine, &range);245 sprintf(tmpLine, "j=%d,d=\"|:p=%g,r=%g\"", C->dadlink->joint_refno, C->P.muscle_power, C->mz); 246 partidx = addFromString(NeuronType, tmpLine, &range); 247 247 if (partidx < 0) return -32; 248 sprintf(tmpLine, " c:%d,%d", partidx, n_refno);249 if ( singleStepBuild(tmpLine, &range) < 0) return -33;248 sprintf(tmpLine, "%d,%d", partidx, n_refno); 249 if (addFromString(NeuronConnectionType, tmpLine, &range) < 0) return -33; 250 250 } 251 251 … … 256 256 257 257 tmpLine[0] = 0; 258 if (1 == C->links[j]->t) sprintf(tmpLine, " n:p=%d,d=\"*\"", p_refno);259 if (2 == C->links[j]->t) sprintf(tmpLine, " n:j=%d,d=\"G\"", C->dadlink->joint_refno);260 if (3 == C->links[j]->t) sprintf(tmpLine, " n:p=%d,d=\"T\"", p_refno);261 if (4 == C->links[j]->t) sprintf(tmpLine, " n:p=%d,d=\"S\"", p_refno);258 if (1 == C->links[j]->t) sprintf(tmpLine, "p=%d,d=\"*\"", p_refno); 259 if (2 == C->links[j]->t) sprintf(tmpLine, "j=%d,d=\"G\"", C->dadlink->joint_refno); 260 if (3 == C->links[j]->t) sprintf(tmpLine, "p=%d,d=\"T\"", p_refno); 261 if (4 == C->links[j]->t) sprintf(tmpLine, "p=%d,d=\"S\"", p_refno); 262 262 int from = -1; 263 263 if (tmpLine[0]) //input from receptor 264 264 { 265 from = singleStepBuild(tmpLine, &range);265 from = addFromString(NeuronType, tmpLine, &range); 266 266 if (from < 0) return -34; 267 267 } /*could be 'else'...*/ … … 270 270 if (from >= 0) 271 271 { 272 sprintf(tmpLine, " c:%d,%d,%g", n_refno, from, C->links[j]->w);273 if ( singleStepBuild(tmpLine, &range) < 0) return -35;272 sprintf(tmpLine, "%d,%d,%g", n_refno, from, C->links[j]->w); 273 if (addFromString(NeuronConnectionType, tmpLine, &range) < 0) return -35; 274 274 } 275 275 }
Note: See TracChangeset
for help on using the changeset viewer.