void NN::delNerveCell(U2 n) /*n为神经元号*/ { if(n<=0) { printf("invaild nerve cell num\n"); exit(ERROR_CODE); } else { LOGICNERVECELL *tmpnc; tmpnc = findNerveCell(n); recycle[recycle_cell] = *nc; tmpnc->next = *nc->next; *nc = frist_nc; /*指向头*/ } recycle_cell++; return; } void NN::connectNerveCell(U2 sou,U2 dec) { /*没有完全完成 一些完善功能没有实现 最重要的扩展数组没有实现*/ U2 init; LOGICNERVECELL *sou_nc,dec_nc,tmpnc; tmpnc = findNerveCell(sou); sou_nc = *nc; tmpnc = findNerveCell(dec); dec_nc = *nc; sou_nc->nc->output = (NERVECELL*)(malloc(sizeof(NERVECELL)*(sou_nc->nc->o_n_cell))); sou_nc->nc->output[tick] = dec_nc; sou_nc->nc->o_is_cell = tick; sou_nc->nc->tick++; dec_nc->nc->input = (NERVECELL*)(malloc(sizeof(NERVECELL)*(dec_nc->nc->i_n_cell))); dec_nc->nc->input[tick] = sou_nc; dec_nc->nc->i_is_cell = tick; dec_nc->nc->tick++; *nc = frist_nc; /*没有完工不想写了 感觉扩展数组 在效率上太慢了 明天改成链表*/ } void NN::disconnectNerveCell(U2 sou,U2 dec) { /*没有完工 好累不写了*/ } 好累 不写了 明天再继续吧!!! 玩魔兽世界去了 呵呵

|