@@ -13,7 +13,7 @@ import (
13
13
// WriteGenomePlain is to write genome of the organism to the genomeFile in the outDir directory using plain encoding.
14
14
// The method return path to the file if successful or error if failed.
15
15
func WriteGenomePlain (genomeFile , outDir string , org * genetics.Organism , epoch * experiment.Generation ) (string , error ) {
16
- orgPath := fmt .Sprintf ("%s/%s_%d-%d" , createOutDirForTrial (outDir , epoch .TrialId ),
16
+ orgPath := fmt .Sprintf ("%s/%s_%d-%d" , CreateOutDirForTrial (outDir , epoch .TrialId ),
17
17
genomeFile , org .Phenotype .NodeCount (), org .Phenotype .LinkCount ())
18
18
if file , err := os .Create (orgPath ); err != nil {
19
19
return "" , err
@@ -26,7 +26,7 @@ func WriteGenomePlain(genomeFile, outDir string, org *genetics.Organism, epoch *
26
26
// WriteGenomeDOT is to write genome of the organism to the genomeFile in the outDir directory using DOT encoding.
27
27
// The method return path to the file if successful or error if failed.
28
28
func WriteGenomeDOT (genomeFile , outDir string , org * genetics.Organism , epoch * experiment.Generation ) (string , error ) {
29
- orgPath := fmt .Sprintf ("%s/%s_%d-%d.dot" , createOutDirForTrial (outDir , epoch .TrialId ),
29
+ orgPath := fmt .Sprintf ("%s/%s_%d-%d.dot" , CreateOutDirForTrial (outDir , epoch .TrialId ),
30
30
genomeFile , org .Phenotype .NodeCount (), org .Phenotype .LinkCount ())
31
31
if file , err := os .Create (orgPath ); err != nil {
32
32
return "" , err
@@ -39,7 +39,7 @@ func WriteGenomeDOT(genomeFile, outDir string, org *genetics.Organism, epoch *ex
39
39
// WriteGenomeCytoscapeJSON is to write genome of the organism to the genomeFile in the outDir directory using Cytoscape JSON encoding.
40
40
// The method return path to the file if successful or error if failed.
41
41
func WriteGenomeCytoscapeJSON (genomeFile , outDir string , org * genetics.Organism , epoch * experiment.Generation ) (string , error ) {
42
- orgPath := fmt .Sprintf ("%s/%s_%d-%d.cyjs" , createOutDirForTrial (outDir , epoch .TrialId ),
42
+ orgPath := fmt .Sprintf ("%s/%s_%d-%d.cyjs" , CreateOutDirForTrial (outDir , epoch .TrialId ),
43
43
genomeFile , org .Phenotype .NodeCount (), org .Phenotype .LinkCount ())
44
44
if file , err := os .Create (orgPath ); err != nil {
45
45
return "" , err
@@ -52,7 +52,7 @@ func WriteGenomeCytoscapeJSON(genomeFile, outDir string, org *genetics.Organism,
52
52
// WritePopulationPlain is to write genomes of the entire population using plain encoding in the outDir directory.
53
53
// The methods return path to the file if successful or error if failed.
54
54
func WritePopulationPlain (outDir string , pop * genetics.Population , epoch * experiment.Generation ) (string , error ) {
55
- popPath := fmt .Sprintf ("%s/gen_%d" , createOutDirForTrial (outDir , epoch .TrialId ), epoch .Id )
55
+ popPath := fmt .Sprintf ("%s/gen_%d" , CreateOutDirForTrial (outDir , epoch .TrialId ), epoch .Id )
56
56
if file , err := os .Create (popPath ); err != nil {
57
57
return "" , err
58
58
} else if err = pop .WriteBySpecies (file ); err != nil {
@@ -61,8 +61,8 @@ func WritePopulationPlain(outDir string, pop *genetics.Population, epoch *experi
61
61
return popPath , nil
62
62
}
63
63
64
- // createOutDirForTrial allows creating the output directory for specific trial using standard name.
65
- func createOutDirForTrial (outDir string , trialID int ) string {
64
+ // CreateOutDirForTrial allows creating the output directory for specific trial of the experiment using standard name.
65
+ func CreateOutDirForTrial (outDir string , trialID int ) string {
66
66
dir := fmt .Sprintf ("%s/%d" , outDir , trialID )
67
67
if _ , err := os .Stat (dir ); err != nil {
68
68
// create output dir
0 commit comments