76
76
import org .neugen .datastructures .Net ;
77
77
import org .neugen .datastructures .Region ;
78
78
import org .neugen .datastructures .xml .XMLObject ;
79
+ import org .neugen .datastructures .xml .XMLNode ;
79
80
import org .neugen .gui .NeuGenConstants ;
80
81
import org .neugen .gui .NeuGenLib ;
81
82
import org .neugen .gui .NeuGenProject ;
@@ -362,7 +363,7 @@ public void create_and_open_project(String projectPath, String sourceTemplate, S
362
363
* @param currentRoot
363
364
* @param projectDirPath
364
365
*/
365
- private void save_param (TreeNode currentRoot , String projectDirPath ) {
366
+ private void save_param (XMLNode currentRoot , String projectDirPath ) {
366
367
save (currentRoot , projectDirPath , NeuGenConstants .PARAM );
367
368
}
368
369
@@ -371,7 +372,7 @@ private void save_param(TreeNode currentRoot, String projectDirPath) {
371
372
* @param currentRoot
372
373
* @param projectDirPath
373
374
*/
374
- private void save_interna (TreeNode currentRoot , String projectDirPath ) {
375
+ private void save_interna (XMLNode currentRoot , String projectDirPath ) {
375
376
save (currentRoot , projectDirPath , NeuGenConstants .INTERNA );
376
377
}
377
378
@@ -391,7 +392,7 @@ public void save(Map<String, XMLObject> paramTrees, String projectDirPath) {
391
392
* @param projectDirPath
392
393
* @param param
393
394
*/
394
- private void save (TreeNode currentRoot , String projectDirPath , String param ) {
395
+ private void save (XMLNode currentRoot , String projectDirPath , String param ) {
395
396
logger .info ("leaf count: " + currentRoot .getLeafCount ());
396
397
397
398
/**
@@ -579,23 +580,23 @@ public void modifyNPartsDensity(double density) {
579
580
for (Map .Entry <String , XMLObject > entry : params .entrySet ()) {
580
581
XMLObject obj = entry .getValue ();
581
582
582
- Enumeration <TreeNode > childs = obj .children ();
583
+ Enumeration <XMLNode > childs = obj .children ();
583
584
584
585
while (childs .hasMoreElements ()) {
585
- TreeNode node = childs .nextElement ();
586
+ XMLNode node = childs .nextElement ();
586
587
if ("neuron" .equals (node .toString ())) {
587
- Enumeration <TreeNode > childs2 = node .children ();
588
+ Enumeration <XMLNode > childs2 = node .children ();
588
589
while (childs2 .hasMoreElements ()) {
589
- TreeNode node2 = childs2 .nextElement ();
590
+ XMLNode node2 = childs2 .nextElement ();
590
591
if ("axon" .equals (node2 .toString ())) {
591
- Enumeration <TreeNode > childs3 = node2 .children ();
592
+ Enumeration <XMLNode > childs3 = node2 .children ();
592
593
while (childs3 .hasMoreElements ()) {
593
- TreeNode child4 = childs3 .nextElement ();
594
+ XMLNode child4 = childs3 .nextElement ();
594
595
if ("gen_0" .equals (child4 .toString ())) {
595
- Enumeration <TreeNode > childs5 = child4 .children ();
596
+ Enumeration <XMLNode > childs5 = child4 .children ();
596
597
597
598
while (childs5 .hasMoreElements ()) {
598
- TreeNode child6 = childs5 .nextElement ();
599
+ XMLNode child6 = childs5 .nextElement ();
599
600
600
601
if ("nparts_density" .equals (child6 .getKey ())) {
601
602
System .err .println ("child6 (before): " + child6 .toString ());
@@ -617,15 +618,15 @@ public void modifyNPartsDensity(double density) {
617
618
618
619
} else if ("dendrite" .equals (node2 .toString ())) {
619
620
620
- Enumeration <TreeNode > childs3 = node2 .children ();
621
+ Enumeration <XMLNode > childs3 = node2 .children ();
621
622
while (childs3 .hasMoreElements ()) {
622
- TreeNode child4 = childs3 .nextElement ();
623
+ XMLNode child4 = childs3 .nextElement ();
623
624
System .err .println ("axon child: " + child4 .toString ());
624
625
if ("gen_0" .equals (child4 .toString ())) {
625
- Enumeration <TreeNode > childs5 = child4 .children ();
626
+ Enumeration <XMLNode > childs5 = child4 .children ();
626
627
627
628
while (childs5 .hasMoreElements ()) {
628
- TreeNode child6 = childs5 .nextElement ();
629
+ XMLNode child6 = childs5 .nextElement ();
629
630
630
631
if ("nparts_density" .equals (child6 .getKey ())) {
631
632
System .err .println ("child6 (before): " + child6 .toString ());
@@ -663,15 +664,15 @@ public void modifySynapseDistance(double dist_synapse) {
663
664
for (Map .Entry <String , XMLObject > entry : params .entrySet ()) {
664
665
XMLObject obj = entry .getValue ();
665
666
@ SuppressWarnings ("unchecked" )
666
- Enumeration <TreeNode > childs = obj .children ();
667
+ Enumeration <XMLNode > childs = obj .children ();
667
668
668
669
while (childs .hasMoreElements ()) {
669
- TreeNode node = childs .nextElement ();
670
+ XMLNode node = childs .nextElement ();
670
671
if ("net" .equals (node .toString ())) {
671
672
@ SuppressWarnings ("unchecked" )
672
- Enumeration <TreeNode > childs2 = node .children ();
673
+ Enumeration <XMLNode > childs2 = node .children ();
673
674
while (childs2 .hasMoreElements ()) {
674
- TreeNode node2 = childs2 .nextElement ();
675
+ XMLNode node2 = childs2 .nextElement ();
675
676
if ("dist_synapse" .equals (node2 .getKey ())) {
676
677
node2 .setValue (dist_synapse );
677
678
}
@@ -693,15 +694,15 @@ public void adjustNetworkSize(int factor) {
693
694
for (Map .Entry <String , XMLObject > entry : params .entrySet ()) {
694
695
XMLObject obj = entry .getValue ();
695
696
@ SuppressWarnings ("unchecked" )
696
- Enumeration <TreeNode > childs = obj .children ();
697
+ Enumeration <XMLNode > childs = obj .children ();
697
698
698
699
while (childs .hasMoreElements ()) {
699
- TreeNode node = childs .nextElement ();
700
+ XMLNode node = childs .nextElement ();
700
701
if ("net" .equals (node .toString ())) {
701
702
@ SuppressWarnings ("unchecked" )
702
- Enumeration <TreeNode > childs2 = node .children ();
703
+ Enumeration <XMLNode > childs2 = node .children ();
703
704
while (childs2 .hasMoreElements ()) {
704
- TreeNode node2 = childs2 .nextElement ();
705
+ XMLNode node2 = childs2 .nextElement ();
705
706
if (! "dist_synapse" .equals (node2 .getKey ())) {
706
707
node2 .setValue (Integer .parseInt (node2 .getValue ().toString ()) * factor );
707
708
}
@@ -769,14 +770,14 @@ private void adjust_cell_number_for_cell_type(String cellType, int numberOfCells
769
770
for (Map .Entry <String , XMLObject > entry : params .entrySet ()) {
770
771
XMLObject obj = entry .getValue ();
771
772
@ SuppressWarnings ("unchecked" )
772
- Enumeration <TreeNode > childs = obj .children ();
773
+ Enumeration <XMLNode > childs = obj .children ();
773
774
while (childs .hasMoreElements ()) {
774
- TreeNode node = childs .nextElement ();
775
+ XMLNode node = childs .nextElement ();
775
776
if ("net" .equals (node .toString ())) {
776
777
@ SuppressWarnings ("unchecked" )
777
- Enumeration <TreeNode > childs2 = node .children ();
778
+ Enumeration <XMLNode > childs2 = node .children ();
778
779
while (childs2 .hasMoreElements ()) {
779
- TreeNode node2 = childs2 .nextElement ();
780
+ XMLNode node2 = childs2 .nextElement ();
780
781
if (cellType .equals (node2 .getKey ())) {
781
782
node2 .setValue (numberOfCells );
782
783
}
@@ -853,10 +854,10 @@ private void modifyParameter(XMLObject paramTree, double param, String identifie
853
854
}
854
855
855
856
ArrayList <String > pathes = new ArrayList <String >(Arrays .asList (identifier .split ("/" )));
856
- Enumeration <TreeNode > childs = paramTree .children ();
857
+ Enumeration <XMLNode > childs = paramTree .children ();
857
858
858
859
while (childs .hasMoreElements ()) {
859
- TreeNode node = childs .nextElement ();
860
+ XMLNode node = childs .nextElement ();
860
861
if (pathes .get (0 ).equals (node .getKey ())) {
861
862
modifyParameter_rec (node ,
862
863
param ,
@@ -876,10 +877,10 @@ private void modifyParameter(XMLObject paramTree, double param, String identifie
876
877
* @param identifier
877
878
*/
878
879
@ SuppressWarnings ("unchecked" )
879
- private void modifyParameter_rec (TreeNode root , double param , ArrayList <String > identifier ) {
880
- Enumeration <TreeNode > childs = root .children ();
880
+ private void modifyParameter_rec (XMLNode root , double param , ArrayList <String > identifier ) {
881
+ Enumeration <XMLNode > childs = root .children ();
881
882
while (childs .hasMoreElements ()) {
882
- TreeNode node = childs .nextElement ();
883
+ XMLNode node = childs .nextElement ();
883
884
if (identifier .get (0 ).equals (node .getKey ())) {
884
885
if (identifier .size () == 1 ) {
885
886
node .setValue (param );
@@ -903,15 +904,15 @@ private void modifyParameter_rec(TreeNode root, double param, ArrayList<String>
903
904
* @param replacement
904
905
*/
905
906
@ SuppressWarnings ("unchecked" )
906
- private void correct_siblings (TreeNode child , String identifier , double replacement ) {
907
- /// only one child called siblings within childs of current TreeNode child
908
- Enumeration <TreeNode > childs = child .children ();
909
- TreeNode sibling = childs .nextElement ();
910
- Enumeration <TreeNode > childs_of_sibling = sibling .children ();
907
+ private void correct_siblings (XMLNode child , String identifier , double replacement ) {
908
+ /// only one child called siblings within childs of current XMLNode child
909
+ Enumeration <XMLNode > childs = child .children ();
910
+ XMLNode sibling = childs .nextElement ();
911
+ Enumeration <XMLNode > childs_of_sibling = sibling .children ();
911
912
912
913
while (childs_of_sibling .hasMoreElements ()) {
913
914
/// current child of current sibling's child
914
- TreeNode current_child = childs_of_sibling .nextElement ();
915
+ XMLNode current_child = childs_of_sibling .nextElement ();
915
916
916
917
/// replace node's content
917
918
if (identifier .equals (current_child .getKey ())) {
0 commit comments