public void adaptSegments(boolean positiveReinforcement){
		//NO WAY to remove synapses added to segment
		//find a method to replace low perm synapses with new comer
		if(segmentUpdateList.size()>0){
			for(SegmentUpdate sUpdate : segmentUpdateList){
				//System.out.print(sUpdate.updateSegment.synapses.size()+"-"+sUpdate.updateSynapsesList.size()+";");
				if(positiveReinforcement){
					if(sUpdate.updateSegment.newSegment==true){
						this.distSegments.add(sUpdate.updateSegment);
						sUpdate.updateSegment.newSegment=false;
					}
					for(Synapse s : sUpdate.updateSynapsesList){
						s.permanenceInc();
						s.updated=true;
					}
					
					for(Synapse s : sUpdate.updateSegment.synapses){
						if(s.updated==false) s.permanenceDec();
						else s.updated=false;
					}
				}else{
					for(Synapse s : sUpdate.updateSynapsesList){
						s.permanenceDec();
					}
				}
			}
		}
	}