Leading Project for Biosimulation > Cell/Biodynamics Simulation > simBio
 

Bug ID S-36: Exchanger Path Bug

Problem

When a simBio protocol file contains multiple file name exchangers, the paths of the files generated by one exchanger mistakenly include the file paths of other exchangers.

Solution

The paths of the generated files should not be mixed together.

Modified file list

  • org.simBio.sim.dm.exchange.FileNameExchanger

Code explanation

The code was tested using matsuoka_et_al_2003/Fig.1A.protocol.xml.The Node targetAttribute_ variable in Exchanger.java is used to hold two different kinds of values:

  1. the membrane potential (mV), which is part of the file path
  2. a complete file path made up of prefix + current time + mV + suffix

1. is returned by UniformValueExchanger.getAllStateString() and 2. is returned by FileNameExchanger.getAllStateString(). In the original code, when Exchanger.getAllStateString() was called, both of the above values would be mixed together, creating incorrect file paths, because the file path for one Exchanger was included in that of another. For example:

/target/matsuoka_et_al_2003/Fig1A/xml/1174869289170_-100.0target/
	matsuoka_et_al_2003/Fig1A/1174869289170_-100.0.csv.xml
			

The expected file path was

/target/matsuoka_et_al_2003/Fig1A/xml/1174869289170_-100.0.xml
			

but this file path had become combined with the file path of the other Exchanger

target/matsuoka_et_al_2003/Fig1A/1174869289170_-100.0.csv

After a getAllStateString() method was added to FileNameExchanger

public String getAllStateString() {
	return childExchanger_.getAllStateString();
}

the generated files had the expected file path:

/target/matsuoka_et_al_2003/Fig1A/xml/1175069427493_-100.0.xml