diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index b743da06a9..45ce9f03be 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -15,7 +15,7 @@ env: jobs: CI-Build: name: CI-build - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 if: ${{ github.event_name == 'push' }} steps: - uses: actions/checkout@v3 @@ -84,7 +84,7 @@ jobs: if: ${{ failure() }} CI-Test: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: matrix: test-group: [Fast, MathGen_IT, SBML_IT, SEDML_SBML_IT, SEDML_VCML_IT, BSTS_IT] @@ -156,7 +156,7 @@ jobs: CD: name: CD - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 if: ${{ github.event_name == 'release' }} steps: diff --git a/Dockerfile b/Dockerfile index 411606fe93..6e9cc825e7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM eclipse-temurin:17 as jre-build +FROM eclipse-temurin:17-jammy as jre-build # Create a custom Java runtime RUN $JAVA_HOME/bin/jlink \ @@ -10,13 +10,12 @@ RUN $JAVA_HOME/bin/jlink \ --output /javaruntime # Define base image and copy in jlink created minimal Java 17 environment -FROM python:3.9.7-slim +FROM ubuntu:jammy ENV JAVA_HOME=/opt/java/openjdk ENV PATH "${JAVA_HOME}/bin:${PATH}" COPY --from=jre-build /javaruntime $JAVA_HOME # now we have Java 17 and Python 3.9 - ARG SIMULATOR_VERSION="7.5.0.11" ARG MAX_JAVA_MEM=0 # Make sure you don't sap all of docker's memory when you set this. @@ -47,8 +46,11 @@ LABEL \ about.tags="rule-based modeling,kinetic modeling,dynamical simulation,systems biology,BNGL,SED-ML,COMBINE,OMEX" \ maintainer="BioSimulators Team " -RUN apt-get -y update -RUN apt-get install -y --no-install-recommends curl dnsutils apt-utils libfreetype6 fontconfig fonts-dejavu +ENV DEBIAN_FRONTEND noninteractive +RUN apt -y update && apt install -y software-properties-common +RUN add-apt-repository ppa:deadsnakes/ppa -y +RUN apt install -y --no-install-recommends curl python3.9-full python3-pip build-essential dnsutils \ + apt-utils libfreetype6 fontconfig fonts-dejavu RUN mkdir -p /usr/local/app/vcell/lib && \ mkdir -p /usr/local/app/vcell/simulation && \ diff --git a/vcell-admin/src/main/java/org/vcell/admin/VCComprehensiveStatistics.java b/vcell-admin/src/main/java/org/vcell/admin/VCComprehensiveStatistics.java index f12fbd9339..8eaf28c422 100644 --- a/vcell-admin/src/main/java/org/vcell/admin/VCComprehensiveStatistics.java +++ b/vcell-admin/src/main/java/org/vcell/admin/VCComprehensiveStatistics.java @@ -10,7 +10,7 @@ import cbit.vcell.server.SimulationJobStatusPersistent; import cbit.vcell.server.SimulationJobStatusPersistent.SchedulerStatus; import cbit.vcell.server.SimulationStatusPersistent; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; import cbit.vcell.xml.XMLSource; import cbit.vcell.xml.XmlHelper; import org.vcell.db.ConnectionFactory; diff --git a/vcell-admin/src/main/java/org/vcell/admin/cli/sim/ResultSetCrawler.java b/vcell-admin/src/main/java/org/vcell/admin/cli/sim/ResultSetCrawler.java index 13faa5353d..5319a225dc 100644 --- a/vcell-admin/src/main/java/org/vcell/admin/cli/sim/ResultSetCrawler.java +++ b/vcell-admin/src/main/java/org/vcell/admin/cli/sim/ResultSetCrawler.java @@ -27,7 +27,6 @@ import cbit.vcell.modeldb.DatabaseServerImpl; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.vcell.db.ConnectionFactory; import org.vcell.util.DataAccessException; import org.vcell.util.document.ExternalDataIdentifier; import org.vcell.util.document.KeyValue; @@ -35,7 +34,7 @@ import org.vcell.util.document.UserInfo; import cbit.vcell.resource.PropertyLoader; -import cbit.vcell.solver.SimulationInfo; +import cbit.vcell.solver.simulation.SimulationInfo; import cbit.vcell.util.AmplistorUtils; diff --git a/vcell-admin/src/main/java/org/vcell/stochtest/StochtestRunService.java b/vcell-admin/src/main/java/org/vcell/stochtest/StochtestRunService.java index 6ca1e20371..9c93bc9f80 100644 --- a/vcell-admin/src/main/java/org/vcell/stochtest/StochtestRunService.java +++ b/vcell-admin/src/main/java/org/vcell/stochtest/StochtestRunService.java @@ -12,7 +12,7 @@ import cbit.vcell.mapping.SimulationContext.MathMappingCallback; import cbit.vcell.mapping.SimulationContext.NetworkGenerationRequirements; import cbit.vcell.mapping.SpeciesContextSpec; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.modeldb.DatabasePolicySQL; import cbit.vcell.modeldb.DatabaseServerImpl; import cbit.vcell.modeldb.ServerDocumentManager; @@ -24,6 +24,8 @@ import cbit.vcell.solver.ode.ODESimData; import cbit.vcell.solver.server.Solver; import cbit.vcell.solver.server.SolverStatus; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationJob; import cbit.vcell.xml.XMLSource; import cbit.vcell.xml.XmlHelper; import cbit.vcell.xml.XmlParseException; @@ -266,7 +268,7 @@ private static void runsolver(Simulation newSimulation, File baseDirectory, int versSimulation = new TempSimulation(newSimulation, false); // printout(ruleBasedTestDir.getAbsolutePath()); destDir = new File(baseDirectory,timeSeriesMultitrialData.datasetName); - SimulationTask simTask = new SimulationTask(new SimulationJob(versSimulation, 0, null),0); + StandardSimulationTask simTask = new StandardSimulationTask(new SimulationJob(versSimulation, 0, null),0); Solver solver = ClientSimManager.createQuickRunSolver(destDir, simTask); solver.startSolver(); diff --git a/vcell-admin/src/test/java/cbit/vcell/client/RuleBasedTest.java b/vcell-admin/src/test/java/cbit/vcell/client/RuleBasedTest.java index c123179349..4d81b5f9ab 100644 --- a/vcell-admin/src/test/java/cbit/vcell/client/RuleBasedTest.java +++ b/vcell-admin/src/test/java/cbit/vcell/client/RuleBasedTest.java @@ -9,7 +9,7 @@ import cbit.vcell.mapping.SimulationContext.NetworkGenerationRequirements; import cbit.vcell.mapping.SpeciesContextSpec; import cbit.vcell.mathmodel.MathModel; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.modeldb.VCDatabaseScanner; import cbit.vcell.modeldb.VCDatabaseVisitor; import cbit.vcell.simdata.ODEDataBlock; @@ -18,6 +18,8 @@ import cbit.vcell.solver.ode.ODESimData; import cbit.vcell.solver.server.Solver; import cbit.vcell.solver.server.SolverStatus; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationJob; import cbit.vcell.xml.XMLSource; import cbit.vcell.xml.XmlHelper; import com.google.gson.Gson; @@ -128,7 +130,7 @@ private static void checkNonspatialStochasticSimContext(SimulationContext srcSim srcSimContext.refreshMathDescription(new MathMappingCallbackTaskAdapter(null),networkGenerationRequirements); //Create non-spatialStoch, ODE and RuleBased sims - Simulation nonspatialStochAppNewSim = + Simulation nonspatialStochAppNewSim = srcSimContext.addNewSimulation(STOCH_SIM_NAME/*SimulationOwner.DEFAULT_SIM_NAME_PREFIX*/,new MathMappingCallbackTaskAdapter(null),networkGenerationRequirements); Simulation newODEAppNewSim = @@ -284,7 +286,7 @@ private static void runsolver(Simulation newSimulation, File baseDirectory, int versSimulation = new TempSimulation(newSimulation, false); // printout(ruleBasedTestDir.getAbsolutePath()); destDir = new File(baseDirectory,timeSeriesMultitrialData.datasetName); - SimulationTask simTask = new SimulationTask(new SimulationJob(versSimulation, 0, null),0); + StandardSimulationTask simTask = new StandardSimulationTask(new SimulationJob(versSimulation, 0, null),0); Solver solver = ClientSimManager.createQuickRunSolver(destDir, simTask); solver.startSolver(); diff --git a/vcell-admin/src/test/java/cbit/vcell/util/TestMissingSimData.java b/vcell-admin/src/test/java/cbit/vcell/util/TestMissingSimData.java index de21978d28..5cf5576b24 100644 --- a/vcell-admin/src/test/java/cbit/vcell/util/TestMissingSimData.java +++ b/vcell-admin/src/test/java/cbit/vcell/util/TestMissingSimData.java @@ -39,8 +39,8 @@ import cbit.vcell.simdata.ODEDataBlock; import cbit.vcell.simdata.SimulationData; import cbit.vcell.simdata.SimulationData.SimDataAmplistorInfo; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationInfo; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationInfo; import cbit.vcell.solver.SolverDescription; import cbit.vcell.solver.VCSimulationDataIdentifier; import cbit.vcell.solver.VCSimulationIdentifier; diff --git a/vcell-api/src/main/java/org/vcell/rest/health/HealthService.java b/vcell-api/src/main/java/org/vcell/rest/health/HealthService.java index 406c5619e3..cb5a94acfa 100644 --- a/vcell-api/src/main/java/org/vcell/rest/health/HealthService.java +++ b/vcell-api/src/main/java/org/vcell/rest/health/HealthService.java @@ -25,7 +25,7 @@ import cbit.vcell.server.SimulationJobStatus; import cbit.vcell.server.SimulationStatus; import cbit.vcell.server.VCellConnection; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; import cbit.vcell.solver.VCSimulationIdentifier; import cbit.vcell.xml.XMLSource; import cbit.vcell.xml.XmlHelper; diff --git a/vcell-api/src/main/java/org/vcell/rest/server/RestDatabaseService.java b/vcell-api/src/main/java/org/vcell/rest/server/RestDatabaseService.java index 2d27ded094..274de22709 100644 --- a/vcell-api/src/main/java/org/vcell/rest/server/RestDatabaseService.java +++ b/vcell-api/src/main/java/org/vcell/rest/server/RestDatabaseService.java @@ -21,7 +21,7 @@ import cbit.vcell.simdata.DataSetMetadata; import cbit.vcell.simdata.DataSetTimeSeries; import cbit.vcell.solver.MathOverrides; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; import cbit.vcell.solver.VCSimulationDataIdentifier; import cbit.vcell.solver.VCSimulationIdentifier; import cbit.vcell.xml.XMLSource; @@ -30,7 +30,6 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.restlet.representation.ByteArrayRepresentation; -import org.restlet.representation.FileRepresentation; import org.vcell.rest.VCellApiApplication; import org.vcell.rest.common.BiomodelOMEXResource; import org.vcell.rest.common.OverrideRepresentation; diff --git a/vcell-api/src/main/java/org/vcell/rest/server/TestRestServerBlinov.java b/vcell-api/src/main/java/org/vcell/rest/server/TestRestServerBlinov.java index d4c0277b5f..f779f0a1db 100644 --- a/vcell-api/src/main/java/org/vcell/rest/server/TestRestServerBlinov.java +++ b/vcell-api/src/main/java/org/vcell/rest/server/TestRestServerBlinov.java @@ -37,7 +37,7 @@ import cbit.vcell.modeldb.SimContextRep; import cbit.vcell.modeldb.SimulationRep; import cbit.vcell.solver.MathOverrides; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; import cbit.vcell.xml.XMLSource; import cbit.vcell.xml.XmlHelper; import freemarker.template.Configuration; diff --git a/vcell-cli/src/main/java/org/vcell/cli/run/ExecutionJob.java b/vcell-cli/src/main/java/org/vcell/cli/run/ExecutionJob.java index e905320499..5f42de353a 100644 --- a/vcell-cli/src/main/java/org/vcell/cli/run/ExecutionJob.java +++ b/vcell-cli/src/main/java/org/vcell/cli/run/ExecutionJob.java @@ -88,8 +88,8 @@ public void preprocessArchive() throws PythonStreamException, IOException { // Unpack the Omex Archive try { // It's unlikely, but if we get errors here they're fatal. - this.sedmlPath2d3d = Paths.get(outputDir, "temp"); this.omexHandler = new OmexHandler(inputFilePath, outputDir); + this.sedmlPath2d3d = Paths.get(outputDir, "temp"); this.omexHandler.extractOmex(); this.sedmlLocations = omexHandler.getSedmlLocationsAbsolute(); } catch (IOException e){ @@ -99,7 +99,7 @@ public void preprocessArchive() throws PythonStreamException, IOException { logger.error(error); throw new RuntimeException(error, e); } catch (Exception e) { - omexHandler.deleteExtractedOmex(); + if (omexHandler != null) omexHandler.deleteExtractedOmex(); String error = e.getMessage() + ", error for archive " + inputFilePath; this.cliRecorder.writeErrorList(bioModelBaseName); this.cliRecorder.writeDetailedResultList(bioModelBaseName + ", " + "unknown error with the archive file"); diff --git a/vcell-cli/src/main/java/org/vcell/cli/run/RunUtils.java b/vcell-cli/src/main/java/org/vcell/cli/run/RunUtils.java index 4b71700196..61cf82e018 100644 --- a/vcell-cli/src/main/java/org/vcell/cli/run/RunUtils.java +++ b/vcell-cli/src/main/java/org/vcell/cli/run/RunUtils.java @@ -9,7 +9,7 @@ import cbit.vcell.parser.SymbolTable; import cbit.vcell.simdata.*; import cbit.vcell.solver.AnnotatedFunction; -import cbit.vcell.solver.SimulationJob; +import cbit.vcell.solver.simulation.SimulationJob; import cbit.vcell.solver.VCSimulationDataIdentifier; import cbit.vcell.solver.VCSimulationIdentifier; import cbit.vcell.solver.ode.ODESolverResultSet; @@ -166,7 +166,7 @@ public static void exportPDE2HDF5(SimulationJob vcellSimJob, File userDir, File // A ton of initialization int jobIndex = vcellSimJob.getJobIndex(); User user = new User(userDir.getName(), null); - cbit.vcell.solver.Simulation vcellSim = vcellSimJob.getSimulation(); + cbit.vcell.solver.simulation.Simulation vcellSim = vcellSimJob.getSimulation(); ExportServiceImpl exportServiceImpl = new ExportServiceImpl(); SimulationContext simContext = (SimulationContext)vcellSim.getSimulationOwner(); @@ -623,8 +623,8 @@ private static void exportDocument(ExportServiceImpl exportServiceImpl, DataServ } private static ExportSpecs getExportSpecs(OutputContext outputContext, User user, DataServerImpl dataServerImpl, VCSimulationDataIdentifier vcId, - DataSetControllerImpl dsControllerImpl, cbit.vcell.solver.Simulation vcellSim, int jobIndex, - VCSimulationIdentifier vcSimID, SimulationContext simContext) throws DataAccessException { + DataSetControllerImpl dsControllerImpl, cbit.vcell.solver.simulation.Simulation vcellSim, int jobIndex, + VCSimulationIdentifier vcSimID, SimulationContext simContext) throws DataAccessException { PDEDataContext pdeDataContext = new ServerPDEDataContext(outputContext, user, dataServerImpl, vcId); List variableNames = RunUtils.getListOfVariableNames(pdeDataContext.getDataIdentifiers()); diff --git a/vcell-cli/src/main/java/org/vcell/cli/run/SolverHandler.java b/vcell-cli/src/main/java/org/vcell/cli/run/SolverHandler.java index 132011d3b0..3bf22b63d4 100644 --- a/vcell-cli/src/main/java/org/vcell/cli/run/SolverHandler.java +++ b/vcell-cli/src/main/java/org/vcell/cli/run/SolverHandler.java @@ -6,7 +6,7 @@ import cbit.vcell.field.FieldDataIdentifierSpec; import cbit.vcell.mapping.MathSymbolMapping; import cbit.vcell.math.FunctionColumnDescription; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.parser.Expression; import cbit.vcell.parser.ExpressionException; import cbit.vcell.parser.ExpressionMathMLParser; @@ -17,6 +17,9 @@ import cbit.vcell.solver.server.Solver; import cbit.vcell.solver.server.SolverFactory; import cbit.vcell.solver.server.SolverStatus; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationJob; +import cbit.vcell.solver.simulation.SimulationOwner; import cbit.vcell.solver.stoch.GibsonSolver; import cbit.vcell.solver.stoch.HybridSolver; import cbit.vcell.solvers.AbstractCompiledSolver; @@ -396,15 +399,15 @@ public void simulateAllTasks(ExternalDocInfo externalDocInfo, SedML sedml, CLIRe AbstractTask task = tempSimulationToTaskMap.get(tempSimulationJob.getTempSimulation()); - SimulationTask simTask; - String kisao = "null"; - ODESolverResultSet odeSolverResultSet = null; - SolverTaskDescription std = null; - SolverDescription sd = null; - int solverStatus = SolverStatus.SOLVER_READY; + StandardSimulationTask simTask; + String kisao = "null"; + ODESolverResultSet odeSolverResultSet = null; + SolverTaskDescription std = null; + SolverDescription sd = null; + int solverStatus = SolverStatus.SOLVER_READY; - Simulation sim = tempSimulationJob.getSimulation(); - simTask = new SimulationTask(tempSimulationJob, 0); + Simulation sim = tempSimulationJob.getSimulation(); + simTask = new StandardSimulationTask(tempSimulationJob, 0); Span sim_span = null; try { sim_span = Tracer.startSpan(Span.ContextType.SIMULATION_RUN, sim.getName(), Map.of("simName", sim.getName())); diff --git a/vcell-cli/src/main/java/org/vcell/cli/run/hdf5/NonspatialResultsConverter.java b/vcell-cli/src/main/java/org/vcell/cli/run/hdf5/NonspatialResultsConverter.java index b3516609d7..86cd76642b 100644 --- a/vcell-cli/src/main/java/org/vcell/cli/run/hdf5/NonspatialResultsConverter.java +++ b/vcell-cli/src/main/java/org/vcell/cli/run/hdf5/NonspatialResultsConverter.java @@ -1,6 +1,6 @@ package org.vcell.cli.run.hdf5; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; import cbit.vcell.parser.ExpressionException; import cbit.vcell.solver.TempSimulation; import ncsa.hdf.hdf5lib.exceptions.HDF5Exception; diff --git a/vcell-cli/src/main/java/org/vcell/cli/run/hdf5/SpatialResultsConverter.java b/vcell-cli/src/main/java/org/vcell/cli/run/hdf5/SpatialResultsConverter.java index b8599dd202..759e1deff7 100644 --- a/vcell-cli/src/main/java/org/vcell/cli/run/hdf5/SpatialResultsConverter.java +++ b/vcell-cli/src/main/java/org/vcell/cli/run/hdf5/SpatialResultsConverter.java @@ -1,7 +1,5 @@ package org.vcell.cli.run.hdf5; -import cbit.vcell.modelopt.MathSystemHash; -import cbit.vcell.solver.Simulation; import cbit.vcell.parser.ExpressionException; import cbit.vcell.solver.TempSimulation; import ncsa.hdf.hdf5lib.exceptions.HDF5Exception; diff --git a/vcell-cli/src/main/java/org/vcell/cli/vcml/VcmlOmexConverter.java b/vcell-cli/src/main/java/org/vcell/cli/vcml/VcmlOmexConverter.java index 3c84eb75e7..942bf4902b 100644 --- a/vcell-cli/src/main/java/org/vcell/cli/vcml/VcmlOmexConverter.java +++ b/vcell-cli/src/main/java/org/vcell/cli/vcml/VcmlOmexConverter.java @@ -4,7 +4,7 @@ import cbit.util.xml.VCLoggerException; import cbit.util.xml.XmlUtil; import cbit.vcell.biomodel.BioModel; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; import cbit.vcell.xml.XmlHelper; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; diff --git a/vcell-cli/src/main/java/org/vcell/cli/vcml/VcmlValidator.java b/vcell-cli/src/main/java/org/vcell/cli/vcml/VcmlValidator.java index 08067de7a4..24f18917c5 100644 --- a/vcell-cli/src/main/java/org/vcell/cli/vcml/VcmlValidator.java +++ b/vcell-cli/src/main/java/org/vcell/cli/vcml/VcmlValidator.java @@ -5,7 +5,7 @@ import cbit.vcell.mapping.SimulationContext; import cbit.vcell.math.MathCompareResults; import cbit.vcell.math.MathDescription; -import cbit.vcell.solver.SimulationSymbolTable; +import cbit.vcell.solver.simulation.SimulationSymbolTable; import cbit.vcell.xml.XMLSource; import cbit.vcell.xml.XmlHelper; import org.apache.logging.log4j.LogManager; diff --git a/vcell-cli/src/test/java/org/vcell/cli/run/BiosimulationsExecTest.java b/vcell-cli/src/test/java/org/vcell/cli/run/BiosimulationsExecTest.java index bef3312cb8..a4aa73b232 100644 --- a/vcell-cli/src/test/java/org/vcell/cli/run/BiosimulationsExecTest.java +++ b/vcell-cli/src/test/java/org/vcell/cli/run/BiosimulationsExecTest.java @@ -173,8 +173,9 @@ public void testBiosimulationsProject(String testCaseProjectID) throws Exception computedH5File.toAbsolutePath().toString() }); command.start(new int[] { 0, 1 }); - assertFalse(command.getStdoutString().contains("position"), "H5 files have significant differences: " + - command.getStdoutString().substring(0, 300)); + String stdOutString = command.getStdoutString(); + assertFalse(stdOutString.contains("position"), "H5 files have significant differences: " + + stdOutString.substring(0, Math.min(300, stdOutString.length()))); } catch (Exception | AssertionError e){ FAULT fault = this.determineFault(e); diff --git a/vcell-client/src/main/java/cbit/plot/gui/Plot2DDataPanel.java b/vcell-client/src/main/java/cbit/plot/gui/Plot2DDataPanel.java index a9b00ec6a2..c8fb997e68 100644 --- a/vcell-client/src/main/java/cbit/plot/gui/Plot2DDataPanel.java +++ b/vcell-client/src/main/java/cbit/plot/gui/Plot2DDataPanel.java @@ -9,7 +9,6 @@ */ package cbit.plot.gui; -import java.awt.Component; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseEvent; @@ -17,27 +16,20 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.ListIterator; -import java.util.Vector; -import javax.swing.ButtonGroup; import javax.swing.JFileChooser; import javax.swing.JFrame; import javax.swing.JMenuItem; -import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JPopupMenu; -import javax.swing.JRadioButton; import javax.swing.KeyStroke; -import javax.swing.table.DefaultTableModel; -import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.vcell.util.UtilCancelException; import org.vcell.util.gui.DialogUtils; import org.vcell.util.gui.NonEditableDefaultTableModel; import org.vcell.util.gui.ScrollTable; -import org.vcell.util.gui.SimpleUserMessage; import org.vcell.util.gui.SpecialtyTableRenderer; import com.google.common.io.Files; @@ -47,11 +39,9 @@ import cbit.vcell.desktop.VCellTransferable; import cbit.vcell.math.ReservedVariable; import cbit.vcell.parser.Expression; -import cbit.vcell.parser.SimpleSymbolTable; import cbit.vcell.parser.SymbolTableEntry; import cbit.vcell.simdata.Hdf5Utils; -import cbit.vcell.simdata.Hdf5Utils.HDF5WriteHelper; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; import ncsa.hdf.hdf5lib.H5; import ncsa.hdf.hdf5lib.HDF5Constants; import javax.swing.JLabel; diff --git a/vcell-client/src/main/java/cbit/plot/gui/PlotPane.java b/vcell-client/src/main/java/cbit/plot/gui/PlotPane.java index af16a2b767..ccba90cbeb 100644 --- a/vcell-client/src/main/java/cbit/plot/gui/PlotPane.java +++ b/vcell-client/src/main/java/cbit/plot/gui/PlotPane.java @@ -26,10 +26,7 @@ import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JScrollPane; -import javax.swing.border.Border; import javax.swing.border.EmptyBorder; -import javax.swing.border.EtchedBorder; -import javax.swing.border.LineBorder; import org.vcell.util.Range; import org.vcell.util.gui.ButtonGroupCivilized; @@ -42,7 +39,7 @@ import cbit.plot.SingleXPlot2D; import cbit.vcell.parser.SymbolTableEntry; import cbit.vcell.solver.DataSymbolMetadata; -import cbit.vcell.solver.SimulationModelInfo.DataSymbolMetadataResolver; +import cbit.vcell.solver.simulation.SimulationModelInfo.DataSymbolMetadataResolver; import cbit.vcell.units.VCUnitDefinition; /** * Insert the type's description here. diff --git a/vcell-client/src/main/java/cbit/vcell/client/BioModelWindowManager.java b/vcell-client/src/main/java/cbit/vcell/client/BioModelWindowManager.java index 5f6349920d..9a65441755 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/BioModelWindowManager.java +++ b/vcell-client/src/main/java/cbit/vcell/client/BioModelWindowManager.java @@ -47,8 +47,8 @@ import cbit.vcell.mapping.SimulationContext; import cbit.vcell.server.SimulationStatus; import cbit.vcell.simdata.DataEvent; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationInfo; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationInfo; import cbit.vcell.solver.VCSimulationDataIdentifier; import cbit.vcell.solver.VCSimulationIdentifier; import cbit.vcell.xml.gui.MIRIAMAnnotationViewer; diff --git a/vcell-client/src/main/java/cbit/vcell/client/ClientRequestManager.java b/vcell-client/src/main/java/cbit/vcell/client/ClientRequestManager.java index 2217a835fd..7ed5fbca45 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/ClientRequestManager.java +++ b/vcell-client/src/main/java/cbit/vcell/client/ClientRequestManager.java @@ -192,8 +192,8 @@ import cbit.vcell.simdata.VCDataManager; import cbit.vcell.simdata.VtkManager; import cbit.vcell.solver.MeshSpecification; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationInfo; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationInfo; import cbit.vcell.solver.VCSimulationDataIdentifier; import cbit.vcell.solver.VCSimulationIdentifier; import cbit.vcell.solver.test.MathTestingUtilities; diff --git a/vcell-client/src/main/java/cbit/vcell/client/ClientSimManager.java b/vcell-client/src/main/java/cbit/vcell/client/ClientSimManager.java index 41f8b3a20c..9ad4f1f55c 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/ClientSimManager.java +++ b/vcell-client/src/main/java/cbit/vcell/client/ClientSimManager.java @@ -61,7 +61,7 @@ import cbit.vcell.mapping.SimulationContext; import cbit.vcell.mapping.SimulationContext.NetworkGenerationRequirements; import cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.parser.ExpressionException; import cbit.vcell.resource.ResourceUtil; import cbit.vcell.server.DataSetController; @@ -75,10 +75,10 @@ import cbit.vcell.simdata.VCDataManager; import cbit.vcell.solver.AnnotatedFunction; import cbit.vcell.solver.DataProcessingInstructions; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationInfo; -import cbit.vcell.solver.SimulationJob; -import cbit.vcell.solver.SimulationOwner; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationInfo; +import cbit.vcell.solver.simulation.SimulationJob; +import cbit.vcell.solver.simulation.SimulationOwner; import cbit.vcell.solver.SolverDescription; import cbit.vcell.solver.SolverException; import cbit.vcell.solver.SolverUtilities; @@ -617,7 +617,7 @@ public void run(Hashtable hashTable) throws Exception { File smoldynExe = exes[0]; Simulation simulation = new TempSimulation(originalSimulation, false); - SimulationTask simTask = new SimulationTask(new SimulationJob(simulation, 0, null),0); + StandardSimulationTask simTask = new StandardSimulationTask(new SimulationJob(simulation, 0, null),0); File inputFile = new File(ResourceUtil.getLocalSimDir(User.tempUser.getName()), simTask.getSimulationJobID() + SimDataConstants.SMOLDYN_INPUT_FILE_EXTENSION); inputFile.deleteOnExit(); PrintWriter pw = new PrintWriter(inputFile); @@ -711,7 +711,7 @@ public void run(Hashtable hashTable) throws Exception { simulation.gatherIssues(issueContext, issueList); DocumentValidUtil.checkIssuesForErrors(issueList); - SimulationTask simTask = new SimulationTask(new SimulationJob(simulation, 0, null),0); + StandardSimulationTask simTask = new StandardSimulationTask(new SimulationJob(simulation, 0, null),0); Solver solver = createQuickRunSolver(localSimDataDir, simTask); if (solver == null) { throw new RuntimeException("null solver"); @@ -913,7 +913,7 @@ public void windowClosing(WindowEvent e) { @Override public void run() { try { - SimulationTask simTask = new SimulationTask(new SimulationJob(simulation, scanNum, null), 0); + StandardSimulationTask simTask = new StandardSimulationTask(new SimulationJob(simulation, scanNum, null), 0); Solver solver = createQuickRunSolver(localSimDataDir, simTask); solver.startSolver(); while(true) { @@ -974,7 +974,7 @@ public void run() { } -public static Solver createQuickRunSolver(File directory, SimulationTask simTask) throws SolverException, IOException { +public static Solver createQuickRunSolver(File directory, StandardSimulationTask simTask) throws SolverException, IOException { SolverDescription solverDescription = simTask.getSimulation().getSolverTaskDescription().getSolverDescription(); if (solverDescription == null) { throw new IllegalArgumentException("SolverDescription cannot be null"); diff --git a/vcell-client/src/main/java/cbit/vcell/client/ClientTaskManager.java b/vcell-client/src/main/java/cbit/vcell/client/ClientTaskManager.java index c40190e17e..ffbc9288a9 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/ClientTaskManager.java +++ b/vcell-client/src/main/java/cbit/vcell/client/ClientTaskManager.java @@ -28,7 +28,7 @@ import cbit.vcell.mapping.SimulationContext.MathMappingCallback; import cbit.vcell.mapping.SimulationContext.NetworkGenerationRequirements; import cbit.vcell.solver.AnnotatedFunction; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; import cbit.vcell.solver.SolverTaskDescription; import cbit.vcell.solver.TimeBounds; import cbit.vcell.solver.UniformOutputTimeSpec; diff --git a/vcell-client/src/main/java/cbit/vcell/client/DatabaseWindowManager.java b/vcell-client/src/main/java/cbit/vcell/client/DatabaseWindowManager.java index 0058696f66..e0acbf9bb6 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/DatabaseWindowManager.java +++ b/vcell-client/src/main/java/cbit/vcell/client/DatabaseWindowManager.java @@ -90,7 +90,7 @@ import cbit.vcell.desktop.VCellBasicCellRenderer.VCDocumentInfoNode; import cbit.vcell.geometry.Geometry; import cbit.vcell.geometry.GeometryInfo; -import cbit.vcell.solver.SimulationOwner; +import cbit.vcell.solver.simulation.SimulationOwner; import cbit.vcell.xml.ExternalDocInfo; import cbit.xml.merge.XmlTreeDiff; diff --git a/vcell-client/src/main/java/cbit/vcell/client/FieldDataWindowManager.java b/vcell-client/src/main/java/cbit/vcell/client/FieldDataWindowManager.java index 135110202e..1508408bfa 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/FieldDataWindowManager.java +++ b/vcell-client/src/main/java/cbit/vcell/client/FieldDataWindowManager.java @@ -19,13 +19,15 @@ import java.lang.reflect.Field; import java.util.Hashtable; import java.util.List; -import java.util.Map; import java.util.Vector; import javax.swing.JPanel; import javax.swing.ListSelectionModel; import cbit.vcell.solver.*; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationModelInfo; +import cbit.vcell.solver.simulation.SimulationOwner; import org.vcell.util.DataAccessException; import org.vcell.util.Issue; import org.vcell.util.IssueContext; diff --git a/vcell-client/src/main/java/cbit/vcell/client/MathModelWindowManager.java b/vcell-client/src/main/java/cbit/vcell/client/MathModelWindowManager.java index 77a1b9901a..656febe34b 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/MathModelWindowManager.java +++ b/vcell-client/src/main/java/cbit/vcell/client/MathModelWindowManager.java @@ -36,8 +36,8 @@ import cbit.vcell.mathmodel.MathModel; import cbit.vcell.server.SimulationStatus; import cbit.vcell.simdata.DataEvent; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationInfo; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationInfo; import cbit.vcell.solver.VCSimulationDataIdentifier; import cbit.vcell.solver.VCSimulationIdentifier; /** diff --git a/vcell-client/src/main/java/cbit/vcell/client/RequestManager.java b/vcell-client/src/main/java/cbit/vcell/client/RequestManager.java index c50f1b273f..7c5b1329bf 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/RequestManager.java +++ b/vcell-client/src/main/java/cbit/vcell/client/RequestManager.java @@ -35,8 +35,8 @@ import cbit.vcell.simdata.DataManager; import cbit.vcell.simdata.OutputContext; import cbit.vcell.simdata.VtkManager; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationInfo; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationInfo; import cbit.xml.merge.XmlTreeDiff; import cbit.xml.merge.gui.TMLPanel; /** @@ -247,7 +247,7 @@ AsynchClientTask[] createNewGeometryTasks(final TopLevelWindowManager requester, * Insert the method's description here. * Creation date: (6/2/2004 2:23:41 AM) * @param documentWindowManager cbit.vcell.client.DocumentWindowManager - * @param simulation cbit.vcell.solver.Simulation + * @param simulation cbit.vcell.solver.simulation.Simulation */ SimulationStatus runSimulation(SimulationInfo simInfo, int numSimulationScanJobs) throws DataAccessException; @@ -256,7 +256,7 @@ AsynchClientTask[] createNewGeometryTasks(final TopLevelWindowManager requester, * Insert the method's description here. * Creation date: (6/2/2004 2:23:41 AM) * @param documentWindowManager cbit.vcell.client.DocumentWindowManager - * @param simulation cbit.vcell.solver.Simulation + * @param simulation cbit.vcell.solver.simulation.Simulation */ void runSimulations(ClientSimManager clientSimManager, Simulation[] simulations); @@ -320,7 +320,7 @@ public void startExport( * Insert the method's description here. * Creation date: (6/2/2004 2:23:41 AM) * @param documentWindowManager cbit.vcell.client.DocumentWindowManager - * @param simulation cbit.vcell.solver.Simulation + * @param simulation cbit.vcell.solver.simulation.Simulation */ void stopSimulations(ClientSimManager clientSimManager, Simulation[] simulations); diff --git a/vcell-client/src/main/java/cbit/vcell/client/RequestManagerAdapter.java b/vcell-client/src/main/java/cbit/vcell/client/RequestManagerAdapter.java index 984335cd29..2590a0d4cd 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/RequestManagerAdapter.java +++ b/vcell-client/src/main/java/cbit/vcell/client/RequestManagerAdapter.java @@ -31,8 +31,8 @@ import cbit.vcell.simdata.DataManager; import cbit.vcell.simdata.OutputContext; import cbit.vcell.simdata.VtkManager; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationInfo; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationInfo; import cbit.xml.merge.XmlTreeDiff; import cbit.xml.merge.gui.TMLPanel; diff --git a/vcell-client/src/main/java/cbit/vcell/client/SimResultsViewerController.java b/vcell-client/src/main/java/cbit/vcell/client/SimResultsViewerController.java index c881e755d7..54cb8c8c09 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/SimResultsViewerController.java +++ b/vcell-client/src/main/java/cbit/vcell/client/SimResultsViewerController.java @@ -23,7 +23,7 @@ import cbit.vcell.simdata.DataManager; import cbit.vcell.simdata.OutputContext; import cbit.vcell.solver.AnnotatedFunction; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; import cbit.vcell.solver.VCSimulationDataIdentifier; import cbit.vcell.solver.VCSimulationIdentifier; /** diff --git a/vcell-client/src/main/java/cbit/vcell/client/SimulationStatusHash.java b/vcell-client/src/main/java/cbit/vcell/client/SimulationStatusHash.java index 688bdf5a29..2bd5d9d482 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/SimulationStatusHash.java +++ b/vcell-client/src/main/java/cbit/vcell/client/SimulationStatusHash.java @@ -13,7 +13,9 @@ import java.util.Hashtable; import cbit.vcell.server.SimulationStatus; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationInfo; + /** * Insert the type's description here. * Creation date: (4/20/2005 1:55:06 PM) @@ -33,7 +35,7 @@ public SimulationStatusHash() { /** * Insert the method's description here. * Creation date: (6/7/2004 12:55:18 PM) - * @param simulations cbit.vcell.solver.Simulation[] + * @param simulations cbit.vcell.solver.simulation.Simulation[] */ public void changeSimulationInstances(Simulation[] newSimulations) { if (newSimulations == null) { @@ -57,8 +59,8 @@ public void changeSimulationInstances(Simulation[] newSimulations) { // // if simulations have the same "authoritative simulation identifier" then use this status // - cbit.vcell.solver.SimulationInfo oldSimInfo = sim.getSimulationInfo(); - cbit.vcell.solver.SimulationInfo newSimInfo = newSimulations[i].getSimulationInfo(); + SimulationInfo oldSimInfo = sim.getSimulationInfo(); + SimulationInfo newSimInfo = newSimulations[i].getSimulationInfo(); if (oldSimInfo!=null && newSimInfo!=null && oldSimInfo.getAuthoritativeVCSimulationIdentifier().equals(newSimInfo.getAuthoritativeVCSimulationIdentifier())){ // // same "job id" ... same status @@ -84,7 +86,7 @@ public void changeSimulationInstances(Simulation[] newSimulations) { * Insert the method's description here. * Creation date: (4/20/2005 1:57:02 PM) * @return cbit.vcell.solver.ode.gui.SimulationStatus - * @param simulation cbit.vcell.solver.Simulation + * @param simulation cbit.vcell.solver.simulation.Simulation */ public SimulationStatus getSimulationStatus(Simulation simulation) { return hash.get(simulation); @@ -94,7 +96,7 @@ public SimulationStatus getSimulationStatus(Simulation simulation) { /** * Insert the method's description here. * Creation date: (4/20/2005 1:57:34 PM) - * @param simulation cbit.vcell.solver.Simulation + * @param simulation cbit.vcell.solver.simulation.Simulation * @param simStatus cbit.vcell.solver.ode.gui.SimulationStatus */ public void setSimulationStatus(Simulation simulation, SimulationStatus simStatus) { diff --git a/vcell-client/src/main/java/cbit/vcell/client/TestingFrameworkWindowManager.java b/vcell-client/src/main/java/cbit/vcell/client/TestingFrameworkWindowManager.java index 79cc473565..b22b1afd3a 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/TestingFrameworkWindowManager.java +++ b/vcell-client/src/main/java/cbit/vcell/client/TestingFrameworkWindowManager.java @@ -134,9 +134,9 @@ import cbit.vcell.solver.AnnotatedFunction.FunctionCategory; import cbit.vcell.solver.DefaultOutputTimeSpec; import cbit.vcell.solver.NonspatialStochSimOptions; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationInfo; -import cbit.vcell.solver.SimulationSymbolTable; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationInfo; +import cbit.vcell.solver.simulation.SimulationSymbolTable; import cbit.vcell.solver.SolverDescription; import cbit.vcell.solver.SolverTaskDescription; import cbit.vcell.solver.VCSimulationDataIdentifier; @@ -1763,8 +1763,8 @@ public static class VariablePair { // * Insert the method's description here. // * Creation date: (11/23/2004 1:53:11 PM) // * @return java.lang.String[] -// * @param sim1 cbit.vcell.solver.Simulation -// * @param sim2 cbit.vcell.solver.Simulation +// * @param sim1 cbit.vcell.solver.simulation.Simulation +// * @param sim2 cbit.vcell.solver.simulation.Simulation // */ //private VariablePair[] getVariableNamesToCompare(BioModel testBioModel,SimulationSymbolTable testSymboltable, SimulationSymbolTable refSymbolTable){ // Vector variablePairs = new Vector(); @@ -2618,8 +2618,8 @@ public SimulationInfo selectRefSimInfo(MathModelInfo mmInfo) { * Insert the method's description here. * Creation date: (11/13/2004 1:52:50 PM) * - * @param sims cbit.vcell.solver.Simulation[] - * @return cbit.vcell.solver.SimulationInfo + * @param sims cbit.vcell.solver.simulation.Simulation[] + * @return cbit.vcell.solver.simulation.SimulationInfo */ private SimulationInfo selectSimInfoPrivate(Simulation[] sims) { diff --git a/vcell-client/src/main/java/cbit/vcell/client/TopLevelWindowManager.java b/vcell-client/src/main/java/cbit/vcell/client/TopLevelWindowManager.java index ab64284d5a..e8d7f6b5e6 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/TopLevelWindowManager.java +++ b/vcell-client/src/main/java/cbit/vcell/client/TopLevelWindowManager.java @@ -61,8 +61,8 @@ import cbit.vcell.mathmodel.MathModel; import cbit.vcell.simdata.DataEvent; import cbit.vcell.simdata.DataListener; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationInfo; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationInfo; import cbit.vcell.solver.VCSimulationIdentifier; import cbit.vcell.solvers.CartesianMesh; /** diff --git a/vcell-client/src/main/java/cbit/vcell/client/data/DataViewer.java b/vcell-client/src/main/java/cbit/vcell/client/data/DataViewer.java index 2c86882549..63fd20e687 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/data/DataViewer.java +++ b/vcell-client/src/main/java/cbit/vcell/client/data/DataViewer.java @@ -17,7 +17,7 @@ import cbit.vcell.client.desktop.biomodel.DocumentEditorSubPanel; import cbit.vcell.export.gui.ExportMonitorPanel; import cbit.vcell.simdata.DataManager; -import cbit.vcell.solver.SimulationModelInfo; +import cbit.vcell.solver.simulation.SimulationModelInfo; /** * Insert the type's description here. * Creation date: (6/14/2004 9:48:35 PM) diff --git a/vcell-client/src/main/java/cbit/vcell/client/data/DefaultDataIdentifierFilter.java b/vcell-client/src/main/java/cbit/vcell/client/data/DefaultDataIdentifierFilter.java index 967f14ff0a..4c394247be 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/data/DefaultDataIdentifierFilter.java +++ b/vcell-client/src/main/java/cbit/vcell/client/data/DefaultDataIdentifierFilter.java @@ -11,8 +11,8 @@ import cbit.vcell.simdata.DataIdentifier; import cbit.vcell.solver.AnnotatedFunction; import cbit.vcell.solver.DataSymbolMetadata; -import cbit.vcell.solver.SimulationModelInfo.DataSymbolMetadataResolver; -import cbit.vcell.solver.SimulationModelInfo.ModelCategoryType; +import cbit.vcell.solver.simulation.SimulationModelInfo.DataSymbolMetadataResolver; +import cbit.vcell.solver.simulation.SimulationModelInfo.ModelCategoryType; public class DefaultDataIdentifierFilter implements DataIdentifierFilter{ private boolean bPostProcessingMode = false; diff --git a/vcell-client/src/main/java/cbit/vcell/client/data/MergedDatasetViewer.java b/vcell-client/src/main/java/cbit/vcell/client/data/MergedDatasetViewer.java index 31854d40e4..b500d95168 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/data/MergedDatasetViewer.java +++ b/vcell-client/src/main/java/cbit/vcell/client/data/MergedDatasetViewer.java @@ -33,7 +33,7 @@ public class MergedDatasetViewer extends DataViewer { /** * Insert the method's description here. * Creation date: (10/17/2005 11:30:45 PM) - * @param simulation cbit.vcell.solver.Simulation + * @param simulation cbit.vcell.solver.simulation.Simulation * @param vcDataManager cbit.vcell.client.server.VCDataManager */ public MergedDatasetViewer(DataManager argDataManager) throws DataAccessException { diff --git a/vcell-client/src/main/java/cbit/vcell/client/data/ODEDataInterface.java b/vcell-client/src/main/java/cbit/vcell/client/data/ODEDataInterface.java index 5507c124a9..80f3382028 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/data/ODEDataInterface.java +++ b/vcell-client/src/main/java/cbit/vcell/client/data/ODEDataInterface.java @@ -7,8 +7,8 @@ import cbit.vcell.math.FunctionColumnDescription; import cbit.vcell.parser.ExpressionException; -import cbit.vcell.solver.SimulationModelInfo.DataSymbolMetadataResolver; -import cbit.vcell.solver.SimulationModelInfo.ModelCategoryType; +import cbit.vcell.solver.simulation.SimulationModelInfo.DataSymbolMetadataResolver; +import cbit.vcell.solver.simulation.SimulationModelInfo.ModelCategoryType; import cbit.vcell.util.ColumnDescription; public interface ODEDataInterface { diff --git a/vcell-client/src/main/java/cbit/vcell/client/data/ODEDataInterfaceImpl.java b/vcell-client/src/main/java/cbit/vcell/client/data/ODEDataInterfaceImpl.java index 112ac42a43..9eb5e52e52 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/data/ODEDataInterfaceImpl.java +++ b/vcell-client/src/main/java/cbit/vcell/client/data/ODEDataInterfaceImpl.java @@ -16,9 +16,9 @@ import cbit.vcell.math.FunctionColumnDescription; import cbit.vcell.parser.ExpressionException; import cbit.vcell.solver.DataSymbolMetadata; -import cbit.vcell.solver.SimulationModelInfo; -import cbit.vcell.solver.SimulationModelInfo.DataSymbolMetadataResolver; -import cbit.vcell.solver.SimulationModelInfo.ModelCategoryType; +import cbit.vcell.solver.simulation.SimulationModelInfo; +import cbit.vcell.solver.simulation.SimulationModelInfo.DataSymbolMetadataResolver; +import cbit.vcell.solver.simulation.SimulationModelInfo.ModelCategoryType; import cbit.vcell.solver.ode.ODESimData; import cbit.vcell.solver.ode.ODESolverResultSet; import cbit.vcell.util.ColumnDescription; diff --git a/vcell-client/src/main/java/cbit/vcell/client/data/ODEDataViewer.java b/vcell-client/src/main/java/cbit/vcell/client/data/ODEDataViewer.java index 7117a14314..49139faef1 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/data/ODEDataViewer.java +++ b/vcell-client/src/main/java/cbit/vcell/client/data/ODEDataViewer.java @@ -9,8 +9,6 @@ */ package cbit.vcell.client.data; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import java.util.HashMap; import java.util.Hashtable; @@ -35,9 +33,8 @@ import cbit.vcell.math.ReservedVariable; import cbit.vcell.simdata.DataManager; import cbit.vcell.solver.DataSymbolMetadata; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationModelInfo; -import cbit.vcell.solver.ode.ODESimData; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationModelInfo; import cbit.vcell.solver.ode.ODESolverResultSet; import cbit.vcell.solver.ode.gui.ODESolverPlotSpecificationPanel; import cbit.vcell.solver.ode.gui.OutputSpeciesResultsPanel; @@ -233,7 +230,7 @@ private PlotPane getPlotPane1() { /** - * Gets the simulation property (cbit.vcell.solver.Simulation) value. + * Gets the simulation property (cbit.vcell.solver.simulation.Simulation) value. * @return The simulation property value. * @see #setSimulation */ @@ -388,7 +385,7 @@ public void setNFSimMolecularConfigurations(NFSimMolecularConfigurations nFSimMo } /** - * Sets the simulation property (cbit.vcell.solver.Simulation) value. + * Sets the simulation property (cbit.vcell.solver.simulation.Simulation) value. * @param simulation The new value for the property. * @see #getSimulation */ diff --git a/vcell-client/src/main/java/cbit/vcell/client/data/ODETimePlotMultipleScansPanel.java b/vcell-client/src/main/java/cbit/vcell/client/data/ODETimePlotMultipleScansPanel.java index 552402d984..371cfc6dbc 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/data/ODETimePlotMultipleScansPanel.java +++ b/vcell-client/src/main/java/cbit/vcell/client/data/ODETimePlotMultipleScansPanel.java @@ -28,19 +28,16 @@ import cbit.plot.Plot2D; import cbit.plot.PlotData; -import cbit.plot.SingleXPlot2D; import cbit.plot.gui.PlotPane; import cbit.vcell.client.task.AsynchClientTask; import cbit.vcell.client.task.ClientTaskDispatcher; -import cbit.vcell.math.ReservedVariable; import cbit.vcell.parser.DivideByZeroException; import cbit.vcell.parser.Expression; import cbit.vcell.parser.ExpressionException; import cbit.vcell.parser.SymbolTableEntry; import cbit.vcell.simdata.DataManager; import cbit.vcell.simdata.ODEDataManager; -import cbit.vcell.solver.DefaultOutputTimeSpec; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; import cbit.vcell.solver.VCSimulationDataIdentifier; import cbit.vcell.solver.VCSimulationIdentifier; import cbit.vcell.solver.ode.ODESolverResultSet; @@ -63,7 +60,7 @@ public class ODETimePlotMultipleScansPanel extends JPanel { /** * Insert the method's description here. * Creation date: (10/17/2005 11:30:45 PM) - * @param simulation cbit.vcell.solver.Simulation + * @param simulation cbit.vcell.solver.simulation.Simulation * @param vcDataManager cbit.vcell.client.server.VCDataManager */ public ODETimePlotMultipleScansPanel(String[] varnames, Simulation arg_simulation, DataManager arg_dataManager,String xVarColumnName) { diff --git a/vcell-client/src/main/java/cbit/vcell/client/data/PDEDataViewer.java b/vcell-client/src/main/java/cbit/vcell/client/data/PDEDataViewer.java index 311550adf0..67709f62e3 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/data/PDEDataViewer.java +++ b/vcell-client/src/main/java/cbit/vcell/client/data/PDEDataViewer.java @@ -162,7 +162,14 @@ import cbit.vcell.simdata.gui.PDEPlotControlPanel; import cbit.vcell.simdata.gui.PdeTimePlotMultipleVariablesPanel; import cbit.vcell.simdata.gui.PdeTimePlotMultipleVariablesPanel.MultiTimePlotHelper; -import cbit.vcell.solver.SimulationModelInfo.DataSymbolMetadataResolver; +import cbit.vcell.solver.AnnotatedFunction; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationModelInfo; +import cbit.vcell.solver.simulation.SimulationModelInfo.DataSymbolMetadataResolver; +import cbit.vcell.solver.simulation.SimulationSymbolTable; +import cbit.vcell.solver.SolverTaskDescription; +import cbit.vcell.solver.VCSimulationDataIdentifier; +import cbit.vcell.solver.VCSimulationDataIdentifierOldStyle; import cbit.vcell.solvers.CartesianMesh; import cbit.vcell.solvers.MembraneElement; import cbit.vcell.solvers.MeshDisplayAdapter; @@ -2006,7 +2013,7 @@ private PDEPlotControlPanel getPDEPlotControlPanel1() { /** - * Gets the simulation property (cbit.vcell.solver.Simulation) value. + * Gets the simulation property (cbit.vcell.solver.simulation.Simulation) value. * @return The simulation property value. * @see #setSimulation */ @@ -2265,7 +2272,7 @@ public void setSimNameSimDataID(ExportSpecs.SimNameSimDataID simNameSimDataID){ getPDEExportPanel1().setPdeDataContext(getPdeDataContext(),simNameSimDataID); } /** - * Sets the simulation property (cbit.vcell.solver.Simulation) value. + * Sets the simulation property (cbit.vcell.solver.simulation.Simulation) value. * @param simulation The new value for the property. * @see #getSimulation */ diff --git a/vcell-client/src/main/java/cbit/vcell/client/data/PDEDataViewerPostProcess.java b/vcell-client/src/main/java/cbit/vcell/client/data/PDEDataViewerPostProcess.java index 9034f726f9..5f566f68b4 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/data/PDEDataViewerPostProcess.java +++ b/vcell-client/src/main/java/cbit/vcell/client/data/PDEDataViewerPostProcess.java @@ -64,8 +64,8 @@ import cbit.vcell.simdata.SpatialSelection; import cbit.vcell.simdata.VCDataManager; import cbit.vcell.solver.AnnotatedFunction; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationModelInfo; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationModelInfo; import cbit.vcell.solver.ode.ODESimData; import cbit.vcell.solvers.CartesianMesh; diff --git a/vcell-client/src/main/java/cbit/vcell/client/data/PDEExportDataPanel.java b/vcell-client/src/main/java/cbit/vcell/client/data/PDEExportDataPanel.java index 7fb8411313..604e60df07 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/data/PDEExportDataPanel.java +++ b/vcell-client/src/main/java/cbit/vcell/client/data/PDEExportDataPanel.java @@ -83,6 +83,9 @@ import cbit.vcell.simdata.SpatialSelection; import cbit.vcell.simdata.SpatialSelectionMembrane; import cbit.vcell.simdata.SpatialSelectionVolume; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.SolverDescription; +import cbit.vcell.solver.SolverTaskDescription; import cbit.vcell.solvers.CartesianMesh; /** * This type was created in VisualAge. diff --git a/vcell-client/src/main/java/cbit/vcell/client/data/SimResultsViewer.java b/vcell-client/src/main/java/cbit/vcell/client/data/SimResultsViewer.java index 764e8a4be9..874792ec84 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/data/SimResultsViewer.java +++ b/vcell-client/src/main/java/cbit/vcell/client/data/SimResultsViewer.java @@ -56,7 +56,7 @@ import cbit.vcell.simdata.ODEDataManager; import cbit.vcell.simdata.PDEDataContext; import cbit.vcell.simdata.PDEDataManager; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; import cbit.vcell.solver.VCSimulationDataIdentifier; import cbit.vcell.solver.ode.ODESimData; import cbit.vcell.solver.ode.ODESolverResultSet; @@ -246,7 +246,7 @@ private javax.swing.JPanel getParamChoicesPanel() { /** * Insert the method's description here. * Creation date: (10/17/2005 11:36:17 PM) - * @return cbit.vcell.solver.Simulation + * @return cbit.vcell.solver.simulation.Simulation */ private Simulation getSimulation() { return simulation; @@ -452,7 +452,7 @@ private void setParamChoicesPanel(javax.swing.JPanel newParamChoicesPanel) { /** * Insert the method's description here. * Creation date: (10/17/2005 11:36:17 PM) - * @param newSimulation cbit.vcell.solver.Simulation + * @param newSimulation cbit.vcell.solver.simulation.Simulation */ private void setSimulation(Simulation newSimulation) { simulation = newSimulation; diff --git a/vcell-client/src/main/java/cbit/vcell/client/data/SimulationWorkspaceModelInfo.java b/vcell-client/src/main/java/cbit/vcell/client/data/SimulationWorkspaceModelInfo.java index 3159fb76a0..301625d18f 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/data/SimulationWorkspaceModelInfo.java +++ b/vcell-client/src/main/java/cbit/vcell/client/data/SimulationWorkspaceModelInfo.java @@ -30,7 +30,6 @@ import cbit.vcell.mapping.AbstractMathMapping.SpeciesConcentrationParameter; import cbit.vcell.mapping.AbstractMathMapping.SpeciesCountParameter; import cbit.vcell.mapping.AssignmentRule; -import cbit.vcell.mapping.MappingException; import cbit.vcell.mapping.MathMapping; import cbit.vcell.mapping.MathSymbolMapping; import cbit.vcell.mapping.NetworkTransformer.GeneratedSpeciesSymbolTableEntry; @@ -38,27 +37,22 @@ import cbit.vcell.mapping.SimulationContext; import cbit.vcell.mapping.StructureMapping; import cbit.vcell.math.MathDescription; -import cbit.vcell.math.MathException; import cbit.vcell.math.ReservedVariable; import cbit.vcell.math.Variable; import cbit.vcell.mathmodel.MathModel; -import cbit.vcell.matrix.MatrixException; import cbit.vcell.model.Kinetics; import cbit.vcell.model.Kinetics.KineticsParameter; import cbit.vcell.model.Kinetics.KineticsProxyParameter; import cbit.vcell.model.Model; -import cbit.vcell.model.Model.ModelParameter; -import cbit.vcell.model.ModelException; import cbit.vcell.model.ModelUnitSystem; import cbit.vcell.model.RbmObservable; import cbit.vcell.model.SpeciesContext; import cbit.vcell.model.Structure; -import cbit.vcell.parser.ExpressionException; import cbit.vcell.parser.SymbolTableEntry; import cbit.vcell.solver.AnnotatedFunction; import cbit.vcell.solver.DataSymbolMetadata; -import cbit.vcell.solver.SimulationModelInfo; -import cbit.vcell.solver.SimulationOwner; +import cbit.vcell.solver.simulation.SimulationModelInfo; +import cbit.vcell.solver.simulation.SimulationOwner; import cbit.vcell.units.VCUnitDefinition; /** diff --git a/vcell-client/src/main/java/cbit/vcell/client/desktop/TestingFrameworkWindowPanel.java b/vcell-client/src/main/java/cbit/vcell/client/desktop/TestingFrameworkWindowPanel.java index fec4f5b046..0468f3c034 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/desktop/TestingFrameworkWindowPanel.java +++ b/vcell-client/src/main/java/cbit/vcell/client/desktop/TestingFrameworkWindowPanel.java @@ -70,7 +70,7 @@ import cbit.vcell.numericstest.TestSuiteInfoNew; import cbit.vcell.numericstest.TestSuiteNew; import cbit.vcell.server.SimulationStatus; -import cbit.vcell.solver.SimulationInfo; +import cbit.vcell.solver.simulation.SimulationInfo; /** * Insert the type's description here. * Creation date: (7/15/2004 2:36:18 PM) diff --git a/vcell-client/src/main/java/cbit/vcell/client/desktop/VCDocumentDecorator.java b/vcell-client/src/main/java/cbit/vcell/client/desktop/VCDocumentDecorator.java index ba0cf22302..a32cafcec4 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/desktop/VCDocumentDecorator.java +++ b/vcell-client/src/main/java/cbit/vcell/client/desktop/VCDocumentDecorator.java @@ -23,8 +23,8 @@ import cbit.vcell.mapping.SimulationContext; import cbit.vcell.mapping.SpeciesContextSpec; import cbit.vcell.mathmodel.MathModel; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationOwner; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationOwner; import cbit.vcell.solver.SolverDescription; import cbit.vcell.solver.SolverDescription.SolverFeature; import cbit.vcell.solver.SolverTaskDescription; diff --git a/vcell-client/src/main/java/cbit/vcell/client/desktop/biomodel/AnnotationsPanel.java b/vcell-client/src/main/java/cbit/vcell/client/desktop/biomodel/AnnotationsPanel.java index 500f8985a2..2b07f09f42 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/desktop/biomodel/AnnotationsPanel.java +++ b/vcell-client/src/main/java/cbit/vcell/client/desktop/biomodel/AnnotationsPanel.java @@ -79,9 +79,7 @@ import cbit.vcell.biomodel.meta.MiriamManager.MiriamResource; import cbit.vcell.client.PopupGenerator; import cbit.vcell.desktop.BioModelCellRenderer; -import cbit.vcell.mapping.ReactionSpec; import cbit.vcell.mapping.SimulationContext; -import cbit.vcell.mapping.SpeciesContextSpec; import cbit.vcell.model.Model; import cbit.vcell.model.RbmObservable; import cbit.vcell.model.ReactionRule; @@ -89,7 +87,6 @@ import cbit.vcell.model.Species; import cbit.vcell.model.SpeciesContext; import cbit.vcell.model.Structure; -import cbit.vcell.solver.Simulation; import cbit.vcell.xml.gui.MiriamTreeModel; import cbit.vcell.xml.gui.MiriamTreeModel.LinkNode; /** diff --git a/vcell-client/src/main/java/cbit/vcell/client/desktop/biomodel/ApplicationComponents.java b/vcell-client/src/main/java/cbit/vcell/client/desktop/biomodel/ApplicationComponents.java index 1eca8a9dc3..c54c08e204 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/desktop/biomodel/ApplicationComponents.java +++ b/vcell-client/src/main/java/cbit/vcell/client/desktop/biomodel/ApplicationComponents.java @@ -13,8 +13,6 @@ import java.util.*; import java.util.Map.Entry; -import org.vcell.util.BeanUtils; - import cbit.vcell.client.BioModelWindowManager; import cbit.vcell.client.ChildWindowManager; import cbit.vcell.client.ChildWindowManager.ChildWindow; @@ -22,7 +20,7 @@ import cbit.vcell.client.desktop.simulation.SimulationWindow; import cbit.vcell.client.desktop.simulation.SimulationWorkspace; import cbit.vcell.mapping.SimulationContext; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; import cbit.vcell.solver.VCSimulationIdentifier; /** * Insert the type's description here. diff --git a/vcell-client/src/main/java/cbit/vcell/client/desktop/biomodel/ApplicationPropertiesTreeModel.java b/vcell-client/src/main/java/cbit/vcell/client/desktop/biomodel/ApplicationPropertiesTreeModel.java index 63827bfcaf..1abe436ae1 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/desktop/biomodel/ApplicationPropertiesTreeModel.java +++ b/vcell-client/src/main/java/cbit/vcell/client/desktop/biomodel/ApplicationPropertiesTreeModel.java @@ -15,7 +15,7 @@ import cbit.vcell.desktop.Annotation; import cbit.vcell.desktop.BioModelNode; import cbit.vcell.mapping.SimulationContext; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; /** * Insert the type's description here. * Creation date: (2/14/01 3:33:23 PM) diff --git a/vcell-client/src/main/java/cbit/vcell/client/desktop/biomodel/BioModelEditor.java b/vcell-client/src/main/java/cbit/vcell/client/desktop/biomodel/BioModelEditor.java index 1eaa09851c..5eb3e7d5c8 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/desktop/biomodel/BioModelEditor.java +++ b/vcell-client/src/main/java/cbit/vcell/client/desktop/biomodel/BioModelEditor.java @@ -53,7 +53,6 @@ import cbit.vcell.clientdb.DocumentManager; import cbit.vcell.data.DataSymbol; import cbit.vcell.desktop.BioModelNode; -import cbit.vcell.desktop.BioModelNode.PublicationInfoNode; import cbit.vcell.geometry.CSGObject; import cbit.vcell.geometry.GeometryInfo; import cbit.vcell.geometry.gui.CSGObjectPropertiesPanel; @@ -86,8 +85,8 @@ import cbit.vcell.model.common.VCellErrorMessages; import cbit.vcell.model.gui.KineticsTypeTemplatePanel; import cbit.vcell.modelopt.ParameterEstimationTask; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationOwner; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationOwner; import cbit.vcell.solver.ode.gui.SimulationSummaryPanel; import cbit.vcell.units.UnitSystemProvider; import cbit.vcell.units.VCUnitSystem; diff --git a/vcell-client/src/main/java/cbit/vcell/client/desktop/biomodel/BioModelEditorApplicationsPanel.java b/vcell-client/src/main/java/cbit/vcell/client/desktop/biomodel/BioModelEditorApplicationsPanel.java index 19fa5ca952..4ddc7b0fbc 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/desktop/biomodel/BioModelEditorApplicationsPanel.java +++ b/vcell-client/src/main/java/cbit/vcell/client/desktop/biomodel/BioModelEditorApplicationsPanel.java @@ -46,7 +46,7 @@ import cbit.vcell.mapping.SimulationContext.MathMappingCallback; import cbit.vcell.mapping.SimulationContext.NetworkGenerationRequirements; import cbit.vcell.resource.PropertyLoader; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; import cbit.vcell.xml.XmlHelper; import cbit.vcell.xml.XmlParseException; import cbit.vcell.xml.Xmlproducer; diff --git a/vcell-client/src/main/java/cbit/vcell/client/desktop/biomodel/IssuePanel.java b/vcell-client/src/main/java/cbit/vcell/client/desktop/biomodel/IssuePanel.java index 07c5c57ded..a7eb8f5618 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/desktop/biomodel/IssuePanel.java +++ b/vcell-client/src/main/java/cbit/vcell/client/desktop/biomodel/IssuePanel.java @@ -51,14 +51,11 @@ import cbit.vcell.mapping.GeometryContext; import cbit.vcell.mapping.GeometryContext.UnmappedGeometryClass; import cbit.vcell.mapping.MicroscopeMeasurement; -import cbit.vcell.mapping.MolecularInternalLinkSpec; import cbit.vcell.mapping.NetworkTransformer; import cbit.vcell.mapping.RateRule; -import cbit.vcell.mapping.ReactionRuleSpec; import cbit.vcell.mapping.ReactionRuleSpec.ReactionRuleCombo; import cbit.vcell.mapping.ReactionSpec.ReactionCombo; import cbit.vcell.mapping.SimulationContext; -import cbit.vcell.mapping.SiteAttributesSpec; import cbit.vcell.mapping.SimulationContext.SimulationContextNameScope; import cbit.vcell.mapping.SpeciesContextSpec; import cbit.vcell.mapping.StructureMapping; @@ -76,8 +73,8 @@ import cbit.vcell.model.Structure; import cbit.vcell.resource.ErrorUtils; import cbit.vcell.solver.OutputFunctionContext.OutputFunctionIssueSource; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationOwner; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationOwner; @SuppressWarnings("serial") public class IssuePanel extends DocumentEditorSubPanel { diff --git a/vcell-client/src/main/java/cbit/vcell/client/desktop/biomodel/IssueTableModel.java b/vcell-client/src/main/java/cbit/vcell/client/desktop/biomodel/IssueTableModel.java index 05ba8b8c6d..f6cbb4d2dc 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/desktop/biomodel/IssueTableModel.java +++ b/vcell-client/src/main/java/cbit/vcell/client/desktop/biomodel/IssueTableModel.java @@ -66,7 +66,7 @@ import cbit.vcell.modelopt.ModelOptimizationSpec; import cbit.vcell.parser.SymbolTableEntry; import cbit.vcell.solver.OutputFunctionContext.OutputFunctionIssueSource; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; @SuppressWarnings("serial") public class IssueTableModel extends VCellSortTableModel implements IssueEventListener { diff --git a/vcell-client/src/main/java/cbit/vcell/client/desktop/mathmodel/MathModelEditor.java b/vcell-client/src/main/java/cbit/vcell/client/desktop/mathmodel/MathModelEditor.java index 1951695449..aa24199d09 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/desktop/mathmodel/MathModelEditor.java +++ b/vcell-client/src/main/java/cbit/vcell/client/desktop/mathmodel/MathModelEditor.java @@ -36,8 +36,8 @@ import cbit.vcell.geometry.gui.CSGObjectPropertiesPanel; import cbit.vcell.geometry.gui.GeometryViewer; import cbit.vcell.mathmodel.MathModel; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationOwner; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationOwner; import cbit.vcell.solver.ode.gui.SimulationSummaryPanel; /** * Insert the type's description here. diff --git a/vcell-client/src/main/java/cbit/vcell/client/desktop/simulation/OutputFunctionsListTableModel.java b/vcell-client/src/main/java/cbit/vcell/client/desktop/simulation/OutputFunctionsListTableModel.java index f9c640f9cc..83eb32d6a6 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/desktop/simulation/OutputFunctionsListTableModel.java +++ b/vcell-client/src/main/java/cbit/vcell/client/desktop/simulation/OutputFunctionsListTableModel.java @@ -33,8 +33,6 @@ import cbit.vcell.mapping.MappingException; import cbit.vcell.mapping.MathMapping; import cbit.vcell.mapping.SimulationContext; -import cbit.vcell.mapping.SimulationContext.MathMappingCallback; -import cbit.vcell.mapping.SimulationContext.NetworkGenerationRequirements; import cbit.vcell.math.InconsistentDomainException; import cbit.vcell.math.MathDescription; import cbit.vcell.math.MathException; @@ -48,7 +46,7 @@ import cbit.vcell.parser.ExpressionException; import cbit.vcell.solver.AnnotatedFunction; import cbit.vcell.solver.OutputFunctionContext; -import cbit.vcell.solver.SimulationOwner; +import cbit.vcell.solver.simulation.SimulationOwner; /** * Insert the type's description here. * Creation date: (5/7/2004 4:07:40 PM) diff --git a/vcell-client/src/main/java/cbit/vcell/client/desktop/simulation/OutputFunctionsPanel.java b/vcell-client/src/main/java/cbit/vcell/client/desktop/simulation/OutputFunctionsPanel.java index 88960e7699..da23409a84 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/desktop/simulation/OutputFunctionsPanel.java +++ b/vcell-client/src/main/java/cbit/vcell/client/desktop/simulation/OutputFunctionsPanel.java @@ -78,8 +78,8 @@ import cbit.vcell.solver.AnnotatedFunction; import cbit.vcell.solver.AnnotatedFunction.FunctionCategory; import cbit.vcell.solver.OutputFunctionContext; -import cbit.vcell.solver.SimulationOwner; -import cbit.vcell.solver.SimulationSymbolTable; +import cbit.vcell.solver.simulation.SimulationOwner; +import cbit.vcell.solver.simulation.SimulationSymbolTable; @SuppressWarnings("serial") public class OutputFunctionsPanel extends DocumentEditorSubPanel { diff --git a/vcell-client/src/main/java/cbit/vcell/client/desktop/simulation/SimulationEditor.java b/vcell-client/src/main/java/cbit/vcell/client/desktop/simulation/SimulationEditor.java index a1aa63c1c0..8c29f21281 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/desktop/simulation/SimulationEditor.java +++ b/vcell-client/src/main/java/cbit/vcell/client/desktop/simulation/SimulationEditor.java @@ -18,14 +18,14 @@ import javax.swing.JPanel; import javax.swing.JTabbedPane; +import cbit.vcell.solver.simulation.Simulation; import org.vcell.util.BeanUtils; import cbit.vcell.geometry.ChomboInvalidGeometryException; import cbit.vcell.math.gui.MeshTabPanel; import cbit.vcell.solver.MeshSpecification; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationOwner; -import cbit.vcell.solver.SimulationOwner.UnitInfo; +import cbit.vcell.solver.simulation.SimulationOwner; +import cbit.vcell.solver.simulation.SimulationOwner.UnitInfo; import cbit.vcell.solver.ode.gui.MathOverridesPanel; import cbit.vcell.solver.ode.gui.SolverTaskDescriptionAdvancedPanel; /** @@ -68,11 +68,11 @@ private void connEtoC1() { } /** - * Gets the clonedSimulation property (cbit.vcell.solver.Simulation) value. + * Gets the clonedSimulation property (cbit.vcell.solver.simulation.Simulation) value. * @return The clonedSimulation property value. * @see #setClonedSimulation */ -public cbit.vcell.solver.Simulation getClonedSimulation() { +public Simulation getClonedSimulation() { return fieldClonedSimulation; } @@ -292,12 +292,12 @@ public void prepareToEdit(Simulation simulation, Component parent) throws Chombo /** - * Sets the clonedSimulation property (cbit.vcell.solver.Simulation) value. + * Sets the clonedSimulation property (cbit.vcell.solver.simulation.Simulation) value. * @param clonedSimulation The new value for the property. * @see #getClonedSimulation */ -private void setClonedSimulation(cbit.vcell.solver.Simulation clonedSimulation) { - cbit.vcell.solver.Simulation oldValue = fieldClonedSimulation; +private void setClonedSimulation(Simulation clonedSimulation) { + Simulation oldValue = fieldClonedSimulation; fieldClonedSimulation = clonedSimulation; firePropertyChange("clonedSimulation", oldValue, clonedSimulation); } diff --git a/vcell-client/src/main/java/cbit/vcell/client/desktop/simulation/SimulationListPanel.java b/vcell-client/src/main/java/cbit/vcell/client/desktop/simulation/SimulationListPanel.java index 9e6c98b650..2dd4442112 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/desktop/simulation/SimulationListPanel.java +++ b/vcell-client/src/main/java/cbit/vcell/client/desktop/simulation/SimulationListPanel.java @@ -46,8 +46,6 @@ import javax.swing.filechooser.FileNameExtensionFilter; import javax.swing.table.TableCellEditor; -import org.vcell.util.ArrayUtils; -import org.vcell.util.BeanUtils; import org.vcell.util.NumberUtils; import org.vcell.util.document.User; import org.vcell.util.gui.DefaultScrollTableActionManager; @@ -79,9 +77,9 @@ import cbit.vcell.model.common.VCellErrorMessages; import cbit.vcell.server.SimulationStatus; import cbit.vcell.solver.OutputTimeSpec; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationOwner; -import cbit.vcell.solver.SimulationOwner.UnitInfo; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationOwner; +import cbit.vcell.solver.simulation.SimulationOwner.UnitInfo; import cbit.vcell.solver.SolverDescription; import cbit.vcell.solver.SolverDescription.SolverFeature; import cbit.vcell.solver.SolverTaskDescription; diff --git a/vcell-client/src/main/java/cbit/vcell/client/desktop/simulation/SimulationListTableModel.java b/vcell-client/src/main/java/cbit/vcell/client/desktop/simulation/SimulationListTableModel.java index ced325702b..90922ef729 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/desktop/simulation/SimulationListTableModel.java +++ b/vcell-client/src/main/java/cbit/vcell/client/desktop/simulation/SimulationListTableModel.java @@ -28,7 +28,7 @@ import cbit.vcell.solver.DefaultOutputTimeSpec; import cbit.vcell.solver.ExplicitOutputTimeSpec; import cbit.vcell.solver.OutputTimeSpec; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; import cbit.vcell.solver.SolverDescription; import cbit.vcell.solver.SolverTaskDescription; import cbit.vcell.solver.UniformOutputTimeSpec; diff --git a/vcell-client/src/main/java/cbit/vcell/client/desktop/simulation/SimulationStatusDetails.java b/vcell-client/src/main/java/cbit/vcell/client/desktop/simulation/SimulationStatusDetails.java index 594c10dfc8..f5ca9971d7 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/desktop/simulation/SimulationStatusDetails.java +++ b/vcell-client/src/main/java/cbit/vcell/client/desktop/simulation/SimulationStatusDetails.java @@ -13,7 +13,7 @@ import cbit.vcell.server.SimulationJobStatus; import cbit.vcell.server.SimulationStatus; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; /** * Insert the type's description here. diff --git a/vcell-client/src/main/java/cbit/vcell/client/desktop/simulation/SimulationStatusDetailsPanel.java b/vcell-client/src/main/java/cbit/vcell/client/desktop/simulation/SimulationStatusDetailsPanel.java index cdc621257d..bcc9cb1966 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/desktop/simulation/SimulationStatusDetailsPanel.java +++ b/vcell-client/src/main/java/cbit/vcell/client/desktop/simulation/SimulationStatusDetailsPanel.java @@ -15,7 +15,7 @@ import org.vcell.util.gui.DateRenderer; import org.vcell.util.gui.ScrollTable; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; /** * Insert the type's description here. diff --git a/vcell-client/src/main/java/cbit/vcell/client/desktop/simulation/SimulationWindow.java b/vcell-client/src/main/java/cbit/vcell/client/desktop/simulation/SimulationWindow.java index ffbfd4ba0a..1417705ef0 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/desktop/simulation/SimulationWindow.java +++ b/vcell-client/src/main/java/cbit/vcell/client/desktop/simulation/SimulationWindow.java @@ -19,8 +19,8 @@ import cbit.vcell.client.title.TitleChanger; import cbit.vcell.client.title.TitleEvent; import cbit.vcell.client.title.TitleListener; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationOwner; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationOwner; import cbit.vcell.solver.VCSimulationIdentifier; public class SimulationWindow implements TitleChanger { @@ -50,7 +50,7 @@ public void propertyChange(PropertyChangeEvent evt){ * Insert the method's description here. * Creation date: (7/20/2004 11:38:49 AM) * @param vcDataIdentifier cbit.vcell.server.VCDataIdentifier - * @param simulation cbit.vcell.solver.Simulation + * @param simulation cbit.vcell.solver.simulation.Simulation * @param simOwner cbit.vcell.document.SimulationOwner * @param dataViewer cbit.vcell.client.data.DataViewer */ @@ -118,7 +118,7 @@ public SimulationOwner getSimOwner() { /** * Insert the method's description here. * Creation date: (7/16/2004 5:16:51 PM) - * @return cbit.vcell.solver.Simulation + * @return cbit.vcell.solver.simulation.Simulation */ public Simulation getSimulation() { return simulation; @@ -137,7 +137,7 @@ public VCSimulationIdentifier getVcSimulationIdentifier() { /** * Insert the method's description here. * Creation date: (7/16/2004 5:16:51 PM) - * @param newSimulation cbit.vcell.solver.Simulation + * @param newSimulation cbit.vcell.solver.simulation.Simulation */ public void resetSimulation(Simulation newSimulation) { if (getSimulation() != null) { @@ -162,7 +162,7 @@ private void setSimOwner(SimulationOwner newSimOwner) { /** * Insert the method's description here. * Creation date: (7/16/2004 5:16:51 PM) - * @param newSimulation cbit.vcell.solver.Simulation + * @param newSimulation cbit.vcell.solver.simulation.Simulation */ private void setSimulation(Simulation newSimulation) { simulation = newSimulation; diff --git a/vcell-client/src/main/java/cbit/vcell/client/desktop/simulation/SimulationWorkspace.java b/vcell-client/src/main/java/cbit/vcell/client/desktop/simulation/SimulationWorkspace.java index 02dce3ba6f..e1fd0008c1 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/desktop/simulation/SimulationWorkspace.java +++ b/vcell-client/src/main/java/cbit/vcell/client/desktop/simulation/SimulationWorkspace.java @@ -27,6 +27,9 @@ import cbit.vcell.server.SimulationStatus; import cbit.vcell.simdata.OutputContext; import cbit.vcell.solver.*; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationOwner; +import cbit.vcell.solver.simulation.SimulationSymbolTable; import edu.uchc.connjur.spectrumtranslator.CodeUtil; import org.vcell.chombo.ChomboMeshValidator; import org.vcell.chombo.ChomboMeshValidator.ChomboMeshRecommendation; @@ -131,7 +134,7 @@ public static String checkCompatibility(SimulationOwner simOwner, Simulation sim * Insert the method's description here. * Creation date: (5/11/2004 2:57:10 PM) * @return boolean - * @param simulation cbit.vcell.solver.Simulation + * @param simulation cbit.vcell.solver.simulation.Simulation */ private static boolean checkSimulationParameters(Simulation simulation, Component parent,boolean bCheckLimits) { SimulationSymbolTable simSymbolTable = new SimulationSymbolTable(simulation, 0); @@ -174,7 +177,7 @@ else if (simulation.getMathDescription().isNonSpatialStoch()) " "+Simulation.MAX_LIMIT_NON_SPATIAL_TIMEPOINTS + " for compartmental simulations\n" + " "+Simulation.MAX_LIMIT_SPATIAL_TIMEPOINTS + " for spatial simulations\n"+ "suggested saving timepoints limits are:\n" + - " "+Simulation.WARNING_NON_SPATIAL_TIMEPOINTS + " for compartmental simulations\n" + + " "+ Simulation.WARNING_NON_SPATIAL_TIMEPOINTS + " for compartmental simulations\n" + " "+Simulation.WARNING_SPATIAL_TIMEPOINTS + " for spatial simulations\n"+ "Try saving fewer timepoints\n"+ "If you need to exceed the quota, please contact us"; @@ -556,7 +559,7 @@ public ClientSimManager getClientSimManager() { * Insert the method's description here. * Creation date: (6/12/2001 10:09:25 AM) * @return boolean - * @param simulation cbit.vcell.solver.Simulation + * @param simulation cbit.vcell.solver.simulation.Simulation */ private static long getExpectedNumTimePoints(Simulation simulation) { return simulation.getSolverTaskDescription().getExpectedNumTimePoints(); @@ -853,7 +856,7 @@ public void setSimulationOwner(SimulationOwner newSimulationOwner) { /** - * Sets the simulations property (cbit.vcell.solver.Simulation[]) value. + * Sets the simulations property (cbit.vcell.solver.simulation.Simulation[]) value. * @param simulations The new value for the property. * @see #getSimulations */ diff --git a/vcell-client/src/main/java/cbit/vcell/client/desktop/testingframework/EditTestCriteriaPanel.java b/vcell-client/src/main/java/cbit/vcell/client/desktop/testingframework/EditTestCriteriaPanel.java index 09ea8253f9..b5c8168377 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/desktop/testingframework/EditTestCriteriaPanel.java +++ b/vcell-client/src/main/java/cbit/vcell/client/desktop/testingframework/EditTestCriteriaPanel.java @@ -10,6 +10,7 @@ package cbit.vcell.client.desktop.testingframework; +import cbit.vcell.solver.simulation.SimulationInfo; import org.vcell.util.document.BioModelInfo; import org.vcell.util.document.MathModelInfo; @@ -19,7 +20,7 @@ import cbit.vcell.numericstest.TestCriteriaNew; import cbit.vcell.numericstest.TestCriteriaNewBioModel; import cbit.vcell.numericstest.TestCriteriaNewMathModel; -import cbit.vcell.solver.SimulationInfo; + /** * Insert the type's description here. * Creation date: (7/20/2004 1:55:07 PM) @@ -284,10 +285,10 @@ private org.vcell.util.document.BioModelInfo getbioModelInfo() { } /** * Return the bmAppSimInfo property value. - * @return cbit.vcell.solver.SimulationInfo + * @return cbit.vcell.solver.simulation.SimulationInfo */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ -private cbit.vcell.solver.SimulationInfo getbmAppSimInfo() { +private SimulationInfo getbmAppSimInfo() { // user code begin {1} // user code end return ivjbmAppSimInfo; @@ -428,7 +429,7 @@ private MathModelInfo getReferenceMathModelInfo() { return fieldReferenceMathModelInfo; } /** - * Gets the referenceSimInfo property (cbit.vcell.solver.SimulationInfo) value. + * Gets the referenceSimInfo property (cbit.vcell.solver.simulation.SimulationInfo) value. * @return The referenceSimInfo property value. * @see #setReferenceSimInfo */ @@ -906,7 +907,7 @@ private void setbioModelInfo(BioModelInfo newValue) { } /** * Set the bmAppSimInfo to a new value. - * @param newValue cbit.vcell.solver.SimulationInfo + * @param newValue cbit.vcell.solver.simulation.SimulationInfo */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ private void setbmAppSimInfo(SimulationInfo newValue) { @@ -957,7 +958,7 @@ public void setReferenceMathModelInfo(MathModelInfo referenceMathModelInfo) { firePropertyChange("referenceMathModelInfo", oldValue, referenceMathModelInfo); } /** - * Sets the referenceSimInfo property (cbit.vcell.solver.SimulationInfo) value. + * Sets the referenceSimInfo property (cbit.vcell.solver.simulation.SimulationInfo) value. * @param referenceSimInfo The new value for the property. * @see #getReferenceSimInfo */ diff --git a/vcell-client/src/main/java/cbit/vcell/client/desktop/testingframework/TestingFrmwkTreeModel.java b/vcell-client/src/main/java/cbit/vcell/client/desktop/testingframework/TestingFrmwkTreeModel.java index dd327a4917..cbec18c8e8 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/desktop/testingframework/TestingFrmwkTreeModel.java +++ b/vcell-client/src/main/java/cbit/vcell/client/desktop/testingframework/TestingFrmwkTreeModel.java @@ -36,7 +36,7 @@ import cbit.vcell.numericstest.TestCriteriaNewMathModel; import cbit.vcell.numericstest.TestSuiteInfoNew; import cbit.vcell.numericstest.TestSuiteNew; -import cbit.vcell.solver.SimulationInfo; +import cbit.vcell.solver.simulation.SimulationInfo; import cbit.vcell.solver.test.VariableComparisonSummary; /** * Insert the type's description here. diff --git a/vcell-client/src/main/java/cbit/vcell/client/task/CheckBeforeDelete.java b/vcell-client/src/main/java/cbit/vcell/client/task/CheckBeforeDelete.java index 00c72b6b93..a9613d8847 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/task/CheckBeforeDelete.java +++ b/vcell-client/src/main/java/cbit/vcell/client/task/CheckBeforeDelete.java @@ -11,7 +11,6 @@ package cbit.vcell.client.task; import java.util.HashMap; import java.util.Hashtable; -import java.util.TreeSet; import org.vcell.util.UserCancelException; import org.vcell.util.document.VCDocument; @@ -22,16 +21,13 @@ import cbit.vcell.client.DocumentWindowManager; import cbit.vcell.client.PopupGenerator; import cbit.vcell.client.UserMessage; -import cbit.vcell.client.task.CheckBeforeDelete.LOW_PRECISION_SAVE; import cbit.vcell.clientdb.DocumentManager; import cbit.vcell.mapping.SimulationContext; import cbit.vcell.math.MathDescription; import cbit.vcell.mathmodel.MathModel; import cbit.vcell.server.SimulationStatus; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationInfo; -import cbit.vcell.xml.XMLSource; -import cbit.vcell.xml.XmlHelper; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationInfo; /** * Insert the type's description here. diff --git a/vcell-client/src/main/java/cbit/vcell/client/task/ChooseFile.java b/vcell-client/src/main/java/cbit/vcell/client/task/ChooseFile.java index 3e48f42b22..7124512d0d 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/task/ChooseFile.java +++ b/vcell-client/src/main/java/cbit/vcell/client/task/ChooseFile.java @@ -51,7 +51,7 @@ import cbit.vcell.mapping.SimulationContext; import cbit.vcell.mapping.SimulationContext.Application; import cbit.vcell.mathmodel.MathModel; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; /** * Insert the type's description here. * Creation date: (5/31/2004 6:03:16 PM) diff --git a/vcell-client/src/main/java/cbit/vcell/client/task/ExportDocument.java b/vcell-client/src/main/java/cbit/vcell/client/task/ExportDocument.java index c95d051c53..68ee973122 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/task/ExportDocument.java +++ b/vcell-client/src/main/java/cbit/vcell/client/task/ExportDocument.java @@ -40,11 +40,11 @@ import cbit.vcell.math.MathException; import cbit.vcell.mathmodel.MathModel; import cbit.vcell.matlab.MatlabOdeFileCoder; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.parser.ExpressionException; import cbit.vcell.solver.OutputFunctionContext; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationJob; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationJob; import cbit.vcell.xml.XmlHelper; /** @@ -354,7 +354,7 @@ else if (fileFilter.equals(FileFilters.FILE_FILTER_SMOLDYN_INPUT)) //----- String baseExportFileName = (scanCount==1?null:exportFile.getPath().substring(0, exportFile.getPath().indexOf("."))); for(int i=0; i hashTable) throws Exception { } SolverUtilities.prepareSolverExecutable(solverDescription); // create solver from SolverFactory - SimulationTask simTask = new SimulationTask(new SimulationJob(finalSim, 0, null),0); + StandardSimulationTask simTask = new StandardSimulationTask(new SimulationJob(finalSim, 0, null),0); // VCSimulationDataIdentifier vcSimulationDataIdentifier = simTask.getSimulationJob().getVCDataIdentifier(); final File localSimDataDir = ResourceUtil.getLocalSimDir(User.tempUser.getName()); File[] files = localSimDataDir.listFiles(); diff --git a/vcell-client/src/main/java/org/vcell/optimization/gui/ParameterEstimationRunTaskPanel.java b/vcell-client/src/main/java/org/vcell/optimization/gui/ParameterEstimationRunTaskPanel.java index b448e6884f..87254ad0e4 100644 --- a/vcell-client/src/main/java/org/vcell/optimization/gui/ParameterEstimationRunTaskPanel.java +++ b/vcell-client/src/main/java/org/vcell/optimization/gui/ParameterEstimationRunTaskPanel.java @@ -37,7 +37,7 @@ import cbit.vcell.opt.CopasiOptimizationMethod.CopasiOptimizationMethodType; import cbit.vcell.parser.ExpressionException; import cbit.vcell.resource.PropertyLoader; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; import cbit.vcell.solver.ode.ODESolverResultSet; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; diff --git a/vcell-client/src/main/java/org/vcell/sbml/gui/SimulationSelectionPanel.java b/vcell-client/src/main/java/org/vcell/sbml/gui/SimulationSelectionPanel.java index 019c2b1d66..cb2088b7b3 100644 --- a/vcell-client/src/main/java/org/vcell/sbml/gui/SimulationSelectionPanel.java +++ b/vcell-client/src/main/java/org/vcell/sbml/gui/SimulationSelectionPanel.java @@ -16,7 +16,7 @@ import javax.swing.JPanel; import javax.swing.JTextPane; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; /** * Insert the type's description here. @@ -24,7 +24,7 @@ * @author: Anuradha Lakshminarayana */ public class SimulationSelectionPanel extends JPanel { - private cbit.vcell.solver.Simulation[] fieldSimulations = null; + private Simulation[] fieldSimulations = null; private boolean ivjConnPtoP2Aligning = false; private javax.swing.DefaultListModel ivjdefaultListModel = null; IvjEventHandler ivjEventHandler = new IvjEventHandler(); @@ -34,7 +34,7 @@ public class SimulationSelectionPanel extends JPanel { private javax.swing.JPanel ivjSimulationsListPanel = null; private javax.swing.JPanel ivjSimulationSummaryPanel = null; private cbit.vcell.solver.ode.gui.SimulationSummaryPanel ivjsimSummaryPanel = null; - private cbit.vcell.solver.Simulation fieldSelectedSimulation = null; + private Simulation fieldSelectedSimulation = null; class IvjEventHandler implements java.beans.PropertyChangeListener, javax.swing.event.ListSelectionListener { public void propertyChange(java.beans.PropertyChangeEvent evt) { @@ -213,11 +213,11 @@ private javax.swing.DefaultListModel getdefaultListModel() { /** - * Gets the selectedSimulation property (cbit.vcell.solver.Simulation) value. + * Gets the selectedSimulation property (cbit.vcell.solver.simulation.Simulation) value. * @return The selectedSimulation property value. * @see #setSelectedSimulation */ -public cbit.vcell.solver.Simulation getSelectedSimulation() { +public Simulation getSelectedSimulation() { return fieldSelectedSimulation; } @@ -287,22 +287,22 @@ private cbit.vcell.solver.ode.gui.SimulationSummaryPanel getsimSummaryPanel() { /** - * Gets the simulations property (cbit.vcell.solver.Simulation[]) value. + * Gets the simulations property (cbit.vcell.solver.simulation.Simulation[]) value. * @return The simulations property value. * @see #setSimulations */ -public cbit.vcell.solver.Simulation[] getSimulations() { +public Simulation[] getSimulations() { return fieldSimulations; } /** - * Gets the simulations index property (cbit.vcell.solver.Simulation) value. + * Gets the simulations index property (cbit.vcell.solver.simulation.Simulation) value. * @return The simulations property value. * @param index The index value into the property array. * @see #setSimulations */ -public cbit.vcell.solver.Simulation getSimulations(int index) { +public Simulation getSimulations(int index) { return getSimulations()[index]; } @@ -487,12 +487,12 @@ public void windowClosing(java.awt.event.WindowEvent e) { /** - * Sets the selectedSimulation property (cbit.vcell.solver.Simulation) value. + * Sets the selectedSimulation property (cbit.vcell.solver.simulation.Simulation) value. * @param selectedSimulation The new value for the property. * @see #getSelectedSimulation */ -public void setSelectedSimulation(cbit.vcell.solver.Simulation selectedSimulation) { - cbit.vcell.solver.Simulation oldValue = fieldSelectedSimulation; +public void setSelectedSimulation(Simulation selectedSimulation) { + Simulation oldValue = fieldSelectedSimulation; fieldSelectedSimulation = selectedSimulation; firePropertyChange("selectedSimulation", oldValue, selectedSimulation); } @@ -523,25 +523,25 @@ private void setsimListSelectionModel(javax.swing.ListSelectionModel newValue) { } /** - * Sets the simulations property (cbit.vcell.solver.Simulation[]) value. + * Sets the simulations property (cbit.vcell.solver.simulation.Simulation[]) value. * @param simulations The new value for the property. * @see #getSimulations */ -public void setSimulations(cbit.vcell.solver.Simulation[] simulations) { - cbit.vcell.solver.Simulation[] oldValue = fieldSimulations; +public void setSimulations(Simulation[] simulations) { + Simulation[] oldValue = fieldSimulations; fieldSimulations = simulations; firePropertyChange("simulations", oldValue, simulations); } /** - * Sets the simulations index property (cbit.vcell.solver.Simulation[]) value. + * Sets the simulations index property (cbit.vcell.solver.simulation.Simulation[]) value. * @param index The index value into the property array. * @param simulations The new value for the property. * @see #getSimulations */ -public void setSimulations(int index, cbit.vcell.solver.Simulation simulations) { - cbit.vcell.solver.Simulation oldValue = fieldSimulations[index]; +public void setSimulations(int index, Simulation simulations) { + Simulation oldValue = fieldSimulations[index]; fieldSimulations[index] = simulations; if (oldValue != null && !oldValue.equals(simulations)) { firePropertyChange("simulations", null, fieldSimulations); diff --git a/vcell-client/src/main/java/org/vcell/util/gui/exporter/MatlabExtensionFilter.java b/vcell-client/src/main/java/org/vcell/util/gui/exporter/MatlabExtensionFilter.java index 77e8c59990..5f5681ebae 100644 --- a/vcell-client/src/main/java/org/vcell/util/gui/exporter/MatlabExtensionFilter.java +++ b/vcell-client/src/main/java/org/vcell/util/gui/exporter/MatlabExtensionFilter.java @@ -11,7 +11,7 @@ import cbit.vcell.mapping.SimulationContext; import cbit.vcell.math.MathDescription; import cbit.vcell.matlab.MatlabOdeFileCoder; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; @SuppressWarnings("serial") public class MatlabExtensionFilter extends SelectorExtensionFilter { diff --git a/vcell-client/src/main/java/org/vcell/util/gui/exporter/NfsimExtensionFilter.java b/vcell-client/src/main/java/org/vcell/util/gui/exporter/NfsimExtensionFilter.java index 61f1b57da2..36a2a9a7ff 100644 --- a/vcell-client/src/main/java/org/vcell/util/gui/exporter/NfsimExtensionFilter.java +++ b/vcell-client/src/main/java/org/vcell/util/gui/exporter/NfsimExtensionFilter.java @@ -11,10 +11,10 @@ import cbit.vcell.biomodel.BioModel; import cbit.vcell.clientdb.DocumentManager; import cbit.vcell.mapping.SimulationContext; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.solver.NFsimSimulationOptions; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationJob; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationJob; @SuppressWarnings("serial") public class NfsimExtensionFilter extends SelectorExtensionFilter { @@ -34,7 +34,7 @@ public void writeBioModel(DocumentManager documentManager, SimulationContext simContexts[] = bioModel.getSimulationContexts(); Simulation selectedSim = simulationContext.getSimulations(0); //Simulation selectedSim = (Simulation)hashTable.get("selectedSimulation"); - SimulationTask simTask = new SimulationTask(new SimulationJob(selectedSim, 0, null),0); + StandardSimulationTask simTask = new StandardSimulationTask(new SimulationJob(selectedSim, 0, null),0); long randomSeed = 0; // a fixed seed will allow us to run reproducible simulations //long randomSeed = System.currentTimeMillis(); NFsimSimulationOptions nfsimSimulationOptions = new NFsimSimulationOptions(); diff --git a/vcell-client/src/main/java/org/vcell/util/gui/exporter/SbmlExtensionFilter.java b/vcell-client/src/main/java/org/vcell/util/gui/exporter/SbmlExtensionFilter.java index e70b592cfd..4f20405763 100644 --- a/vcell-client/src/main/java/org/vcell/util/gui/exporter/SbmlExtensionFilter.java +++ b/vcell-client/src/main/java/org/vcell/util/gui/exporter/SbmlExtensionFilter.java @@ -27,8 +27,7 @@ import cbit.vcell.mapping.SimulationContext; import cbit.vcell.mapping.StructureMapping; import cbit.vcell.model.Structure; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationJob; +import cbit.vcell.solver.simulation.Simulation; import cbit.vcell.xml.XmlHelper; @SuppressWarnings("serial") diff --git a/vcell-client/src/main/java/org/vcell/util/gui/exporter/SmoldynExtensionFilter.java b/vcell-client/src/main/java/org/vcell/util/gui/exporter/SmoldynExtensionFilter.java index ad35b668c0..64e4ce2ffc 100644 --- a/vcell-client/src/main/java/org/vcell/util/gui/exporter/SmoldynExtensionFilter.java +++ b/vcell-client/src/main/java/org/vcell/util/gui/exporter/SmoldynExtensionFilter.java @@ -13,9 +13,9 @@ import cbit.vcell.client.PopupGenerator; import cbit.vcell.clientdb.DocumentManager; import cbit.vcell.mapping.SimulationContext; -import cbit.vcell.messaging.server.SimulationTask; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationJob; +import cbit.vcell.messaging.server.StandardSimulationTask; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationJob; @SuppressWarnings("serial") public class SmoldynExtensionFilter extends SelectorExtensionFilter{ /** @@ -68,7 +68,7 @@ public void writeBioModel(DocumentManager documentManager, BioModel bioModel, Fi String baseExportFileName = exportFile.getPath().substring(0, exportFile.getPath().indexOf(".")); for(int i=0; i - https://github.com/virtualcell/vcell-solvers/releases/download/v0.0.40/win64.zip + https://github.com/virtualcell/vcell-solvers/releases/download/v0.0.44-dev2/win64.zip true ${project.build.directory}/../../localsolvers/win64 @@ -571,7 +571,7 @@ wget - https://github.com/virtualcell/vcell-solvers/releases/download/v0.0.43/mac64.tgz + https://github.com/virtualcell/vcell-solvers/releases/download/v0.0.44-dev2/mac64.tgz true ${project.build.directory}/../../localsolvers/mac64 @@ -656,7 +656,7 @@ wget - https://github.com/virtualcell/vcell-solvers/releases/download/v0.0.40/linux64.tgz + https://github.com/virtualcell/vcell-solvers/releases/download/v0.0.44-dev2/linux64.tgz true ${project.build.directory}/../../localsolvers/linux64 @@ -668,7 +668,7 @@ wget - https://github.com/virtualcell/vcell-solvers/releases/download/v0.0.40/win64.zip + https://github.com/virtualcell/vcell-solvers/releases/download/v0.0.44-dev2/win64.zip true ${project.build.directory}/../../localsolvers/win64 true @@ -681,7 +681,7 @@ wget - https://github.com/virtualcell/vcell-solvers/releases/download/v0.0.43/mac64.tgz + https://github.com/virtualcell/vcell-solvers/releases/download/v0.0.44-dev2/mac64.tgz true ${project.build.directory}/../../localsolvers/mac64 diff --git a/vcell-core/src/main/java/cbit/plot/Plot2D.java b/vcell-core/src/main/java/cbit/plot/Plot2D.java index 8bc697f782..3a7f4fc9da 100644 --- a/vcell-core/src/main/java/cbit/plot/Plot2D.java +++ b/vcell-core/src/main/java/cbit/plot/Plot2D.java @@ -19,7 +19,7 @@ import cbit.vcell.math.ReservedVariable; import cbit.vcell.parser.SymbolTableEntry; -import cbit.vcell.solver.SimulationModelInfo.DataSymbolMetadataResolver; +import cbit.vcell.solver.simulation.SimulationModelInfo.DataSymbolMetadataResolver; /** * Insert the type's description here. * Creation date: (2/8/2001 12:43:18 PM) diff --git a/vcell-core/src/main/java/cbit/plot/SingleXPlot2D.java b/vcell-core/src/main/java/cbit/plot/SingleXPlot2D.java index f84ace0173..0b8e1a5b01 100644 --- a/vcell-core/src/main/java/cbit/plot/SingleXPlot2D.java +++ b/vcell-core/src/main/java/cbit/plot/SingleXPlot2D.java @@ -11,7 +11,7 @@ package cbit.plot; import cbit.vcell.parser.SymbolTableEntry; -import cbit.vcell.solver.SimulationModelInfo.DataSymbolMetadataResolver; +import cbit.vcell.solver.simulation.SimulationModelInfo.DataSymbolMetadataResolver; /** * Insert the type's description here. diff --git a/vcell-core/src/main/java/cbit/rmi/event/SimulationJobStatusEvent.java b/vcell-core/src/main/java/cbit/rmi/event/SimulationJobStatusEvent.java index 44433c6982..c51c2f8cce 100644 --- a/vcell-core/src/main/java/cbit/rmi/event/SimulationJobStatusEvent.java +++ b/vcell-core/src/main/java/cbit/rmi/event/SimulationJobStatusEvent.java @@ -26,7 +26,7 @@ import cbit.vcell.server.SimulationJobStatus.SchedulerStatus; import cbit.vcell.server.SimulationJobStatus.SimulationQueueID; import cbit.vcell.server.SimulationQueueEntryStatus; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; import cbit.vcell.solver.VCSimulationIdentifier; import cbit.vcell.solver.server.SimulationMessage; import cbit.vcell.solver.server.SimulationMessage.DetailedState; diff --git a/vcell-core/src/main/java/cbit/rmi/event/WorkerEvent.java b/vcell-core/src/main/java/cbit/rmi/event/WorkerEvent.java index 3c5c4a2392..961edae2c9 100644 --- a/vcell-core/src/main/java/cbit/rmi/event/WorkerEvent.java +++ b/vcell-core/src/main/java/cbit/rmi/event/WorkerEvent.java @@ -12,9 +12,9 @@ import org.vcell.util.document.User; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.server.HtcJobID; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; import cbit.vcell.solver.VCSimulationDataIdentifier; import cbit.vcell.solver.VCSimulationIdentifier; import cbit.vcell.solver.server.SimulationMessage; @@ -69,11 +69,11 @@ public WorkerEvent(int eventType0, Object source, VCSimulationIdentifier simId0, // this(eventType0, source, simJob.getVCDataIdentifier().getVcSimID(), simJob.getJobIndex(), hostName0, 0, progress0, timePoint0, message); //} // -public WorkerEvent(int eventType0, Object source, SimulationTask simTask, String hostName0, Double progress0, Double timePoint0, SimulationMessage message) { +public WorkerEvent(int eventType0, Object source, StandardSimulationTask simTask, String hostName0, Double progress0, Double timePoint0, SimulationMessage message) { this(eventType0, source, simTask.getSimulationInfo().getAuthoritativeVCSimulationIdentifier(), simTask.getSimulationJob().getJobIndex(), hostName0, simTask.getTaskID(), progress0, timePoint0, message); } -public WorkerEvent(int eventType0, Object source, SimulationTask simTask, String hostName0, SimulationMessage message) { +public WorkerEvent(int eventType0, Object source, StandardSimulationTask simTask, String hostName0, SimulationMessage message) { this(eventType0, source, simTask.getSimulationInfo().getAuthoritativeVCSimulationIdentifier(), simTask.getSimulationJob().getJobIndex(), hostName0, simTask.getTaskID(), null, null, message); } @@ -180,7 +180,7 @@ public boolean isIntendedFor(User user){ /** * Insert the method's description here. * Creation date: (12/31/2003 12:56:45 PM) - * @return cbit.vcell.solver.SimulationInfo + * @return cbit.vcell.solver.simulation.SimulationInfo */ public VCSimulationDataIdentifier getVCSimulationDataIdentifier() { return new VCSimulationDataIdentifier(vcSimulationIdentifier, jobIndex); diff --git a/vcell-core/src/main/java/cbit/vcell/biomodel/BioModel.java b/vcell-core/src/main/java/cbit/vcell/biomodel/BioModel.java index c4d0fa7d81..2de295dfce 100644 --- a/vcell-core/src/main/java/cbit/vcell/biomodel/BioModel.java +++ b/vcell-core/src/main/java/cbit/vcell/biomodel/BioModel.java @@ -55,7 +55,7 @@ import cbit.vcell.parser.ExpressionException; import cbit.vcell.parser.NameScope; import cbit.vcell.parser.SymbolTableEntry; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; /** * Insert the type's description here. @@ -686,7 +686,7 @@ public boolean hasSimulation(String simName){ } /** - * Gets the simulations property (cbit.vcell.solver.Simulation[]) value. + * Gets the simulations property (cbit.vcell.solver.simulation.Simulation[]) value. * * @return The simulations property value. * @see #setSimulations @@ -697,7 +697,7 @@ public Simulation[] getSimulations(){ /** - * Gets the simulations index property (cbit.vcell.solver.Simulation) value. + * Gets the simulations index property (cbit.vcell.solver.simulation.Simulation) value. * * @param index The index value into the property array. * @return The simulations property value. @@ -713,7 +713,7 @@ public Simulation getSimulation(int index){ * Creation date: (1/17/01 12:59:40 PM) * * @param simulationContext cbit.vcell.mapping.SimulationContext - * @return cbit.vcell.solver.Simulation[] + * @return cbit.vcell.solver.simulation.Simulation[] */ public Simulation[] getSimulations(SimulationContext simulationContext){ if(simulationContext == null){ @@ -1062,7 +1062,7 @@ public void setSimulationContexts(SimulationContext[] simulationContexts) throws /** - * Sets the simulations property (cbit.vcell.solver.Simulation[]) value. + * Sets the simulations property (cbit.vcell.solver.simulation.Simulation[]) value. * * @param simulations The new value for the property. * @throws java.beans.PropertyVetoException The exception description. diff --git a/vcell-core/src/main/java/cbit/vcell/biomodel/BioModelTransforms.java b/vcell-core/src/main/java/cbit/vcell/biomodel/BioModelTransforms.java index 014690c610..d41203bf6b 100644 --- a/vcell-core/src/main/java/cbit/vcell/biomodel/BioModelTransforms.java +++ b/vcell-core/src/main/java/cbit/vcell/biomodel/BioModelTransforms.java @@ -8,8 +8,8 @@ import cbit.vcell.model.*; import cbit.vcell.parser.*; import cbit.vcell.solver.MathOverrides; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationSymbolTable; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationSymbolTable; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.vcell.util.TokenMangler; diff --git a/vcell-core/src/main/java/cbit/vcell/biomodel/ModelUnitConverter.java b/vcell-core/src/main/java/cbit/vcell/biomodel/ModelUnitConverter.java index 194235f421..54921ac43e 100644 --- a/vcell-core/src/main/java/cbit/vcell/biomodel/ModelUnitConverter.java +++ b/vcell-core/src/main/java/cbit/vcell/biomodel/ModelUnitConverter.java @@ -7,7 +7,6 @@ import cbit.vcell.matrix.RationalNumber; import cbit.vcell.model.*; import cbit.vcell.parser.*; -import cbit.vcell.solver.Simulation; import cbit.vcell.units.VCUnitDefinition; import cbit.vcell.xml.XMLSource; import cbit.vcell.xml.XmlHelper; diff --git a/vcell-core/src/main/java/cbit/vcell/biomodel/VCellNames.java b/vcell-core/src/main/java/cbit/vcell/biomodel/VCellNames.java index 35a57b9f79..d540c52072 100644 --- a/vcell-core/src/main/java/cbit/vcell/biomodel/VCellNames.java +++ b/vcell-core/src/main/java/cbit/vcell/biomodel/VCellNames.java @@ -9,6 +9,8 @@ */ package cbit.vcell.biomodel; +import cbit.vcell.solver.simulation.Simulation; + import java.util.Hashtable; /** * Insert the type's description here. @@ -23,7 +25,7 @@ public class VCellNames { hash.put(cbit.vcell.biomodel.BioModel.class, "BioModel"); hash.put(cbit.vcell.mapping.SimulationContext.class, "Application"); hash.put(cbit.vcell.model.Model.class, "Physiology"); - hash.put(cbit.vcell.solver.Simulation.class, "Simulation"); + hash.put(Simulation.class, "Simulation"); }; /** diff --git a/vcell-core/src/main/java/cbit/vcell/biomodel/meta/VCMetaData.java b/vcell-core/src/main/java/cbit/vcell/biomodel/meta/VCMetaData.java index ebef500def..4bcb0eb249 100644 --- a/vcell-core/src/main/java/cbit/vcell/biomodel/meta/VCMetaData.java +++ b/vcell-core/src/main/java/cbit/vcell/biomodel/meta/VCMetaData.java @@ -43,7 +43,6 @@ import org.vcell.util.Compare; import org.vcell.util.Displayable; import org.vcell.util.document.Identifiable; -import org.openrdf.model.Resource; import org.vcell.util.document.KeyValue; import cbit.vcell.biomodel.BioModel; @@ -59,7 +58,7 @@ import cbit.vcell.model.Species; import cbit.vcell.model.SpeciesContext; import cbit.vcell.model.Structure; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; import cbit.vcell.xml.XMLTags; /** diff --git a/vcell-core/src/main/java/cbit/vcell/biomodel/meta/VCMetaDataMiriamManager.java b/vcell-core/src/main/java/cbit/vcell/biomodel/meta/VCMetaDataMiriamManager.java index b7bf1cf32e..31f79b7ba4 100644 --- a/vcell-core/src/main/java/cbit/vcell/biomodel/meta/VCMetaDataMiriamManager.java +++ b/vcell-core/src/main/java/cbit/vcell/biomodel/meta/VCMetaDataMiriamManager.java @@ -43,12 +43,9 @@ import org.vcell.sybil.models.miriam.MIRIAMRef.URNParseFailureException; import org.vcell.sybil.models.miriam.MIRIAMizer; import org.vcell.sybil.models.miriam.RefGroup; -import org.vcell.util.Compare; -import org.vcell.util.Matchable; import org.vcell.util.document.Identifiable; import cbit.vcell.biomodel.BioModel; -import cbit.vcell.biomodel.meta.MiriamManager.MiriamResource; import cbit.vcell.biomodel.meta.registry.Registry; import cbit.vcell.biomodel.meta.registry.Registry.Entry; import cbit.vcell.mapping.ReactionSpec; @@ -59,9 +56,8 @@ import cbit.vcell.model.ReactionRule; import cbit.vcell.model.ReactionStep; import cbit.vcell.model.Species; -import cbit.vcell.model.SpeciesContext; import cbit.vcell.model.Structure; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; @SuppressWarnings("serial") public class VCMetaDataMiriamManager implements MiriamManager, Serializable { diff --git a/vcell-core/src/main/java/cbit/vcell/clientdb/ClientDocumentManager.java b/vcell-core/src/main/java/cbit/vcell/clientdb/ClientDocumentManager.java index a84c82554a..c751ae79a9 100644 --- a/vcell-core/src/main/java/cbit/vcell/clientdb/ClientDocumentManager.java +++ b/vcell-core/src/main/java/cbit/vcell/clientdb/ClientDocumentManager.java @@ -93,8 +93,8 @@ import cbit.vcell.server.SessionManager; import cbit.vcell.server.SimulationStatus; import cbit.vcell.server.UserMetaDbServer; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationInfo; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationInfo; import cbit.vcell.solver.VCSimulationIdentifier; import cbit.vcell.xml.VCMLComparator; import cbit.vcell.xml.XMLSource; diff --git a/vcell-core/src/main/java/cbit/vcell/export/SpringSaLaDExporter.java b/vcell-core/src/main/java/cbit/vcell/export/SpringSaLaDExporter.java index 63e8f76df4..215bc1a7ca 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/SpringSaLaDExporter.java +++ b/vcell-core/src/main/java/cbit/vcell/export/SpringSaLaDExporter.java @@ -15,7 +15,6 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; -import java.nio.file.Paths; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -25,7 +24,6 @@ import javax.swing.JPanel; import org.vcell.model.rbm.MolecularType; -import org.vcell.model.rbm.SpeciesPattern; import org.vcell.solver.langevin.LangevinLngvWriter; import org.vcell.util.Pair; @@ -38,16 +36,14 @@ import cbit.vcell.mapping.ReactionSpec; import cbit.vcell.mapping.SimulationContext; import cbit.vcell.mapping.SpeciesContextSpec; -import cbit.vcell.mapping.SpeciesContextSpec.SpeciesContextSpecParameter; import cbit.vcell.model.Model; import cbit.vcell.model.RbmKineticLaw; import cbit.vcell.model.ReactionRule; -import cbit.vcell.model.Species; import cbit.vcell.model.SpeciesContext; import cbit.vcell.model.Structure; import cbit.vcell.parser.Expression; import cbit.vcell.solver.LangevinSimulationOptions; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; public class SpringSaLaDExporter { diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/ExportSpecs.java b/vcell-core/src/main/java/cbit/vcell/export/server/ExportSpecs.java index ddab2a1ccf..50ac8df22e 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/ExportSpecs.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/ExportSpecs.java @@ -12,7 +12,7 @@ import java.io.Serializable; import java.util.Arrays; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; import org.vcell.util.BeanUtils; import org.vcell.util.Compare; import org.vcell.util.Matchable; @@ -256,7 +256,7 @@ public VariableSpecs getVariableSpecs() { /** * Insert the method's description here. * Creation date: (4/1/2001 7:20:40 PM) - * @return cbit.vcell.solver.SimulationInfo + * @return cbit.vcell.solver.simulation.SimulationInfo */ public org.vcell.util.document.VCDataIdentifier getVCDataIdentifier() { return vcDataIdentifier; diff --git a/vcell-core/src/main/java/cbit/vcell/mapping/AbstractMathMapping.java b/vcell-core/src/main/java/cbit/vcell/mapping/AbstractMathMapping.java index 8761d282a5..7715e21802 100644 --- a/vcell-core/src/main/java/cbit/vcell/mapping/AbstractMathMapping.java +++ b/vcell-core/src/main/java/cbit/vcell/mapping/AbstractMathMapping.java @@ -59,7 +59,7 @@ import cbit.vcell.parser.ScopedSymbolTable; import cbit.vcell.parser.SymbolTableEntry; import cbit.vcell.parser.VCUnitEvaluator; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; import cbit.vcell.units.VCUnitDefinition; import cbit.vcell.units.VCUnitException; diff --git a/vcell-core/src/main/java/cbit/vcell/mapping/SimulationContext.java b/vcell-core/src/main/java/cbit/vcell/mapping/SimulationContext.java index f05c474c41..a7d5f8d813 100644 --- a/vcell-core/src/main/java/cbit/vcell/mapping/SimulationContext.java +++ b/vcell-core/src/main/java/cbit/vcell/mapping/SimulationContext.java @@ -22,6 +22,8 @@ import cbit.vcell.biomodel.meta.VCID; import cbit.vcell.math.*; import cbit.vcell.solver.*; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationOwner; import org.vcell.model.rbm.NetworkConstraints; import org.vcell.sbml.vcell.StructureSizeSolver; import org.vcell.util.*; @@ -1230,8 +1232,8 @@ public Simulation copySimulation(Simulation simulation) throws java.beans.Proper * Insert the method's description here. * Creation date: (5/7/2004 1:41:57 PM) * - * @param allSimulations cbit.vcell.solver.Simulation[] - * @return cbit.vcell.solver.Simulation[] + * @param allSimulations cbit.vcell.solver.simulation.Simulation[] + * @return cbit.vcell.solver.simulation.Simulation[] */ private Simulation[] extractLocalSimulations(Simulation[] allSimulations){ ArrayList list = new ArrayList(); diff --git a/vcell-core/src/main/java/cbit/vcell/math/Equation.java b/vcell-core/src/main/java/cbit/vcell/math/Equation.java index 7209549cb1..bf456927ad 100644 --- a/vcell-core/src/main/java/cbit/vcell/math/Equation.java +++ b/vcell-core/src/main/java/cbit/vcell/math/Equation.java @@ -117,13 +117,13 @@ protected boolean compareEqual0(Equation equ) { /** * Insert the method's description here. * Creation date: (10/10/2002 10:31:03 AM) - * @param sim cbit.vcell.solver.Simulation + * @param sim cbit.vcell.solver.simulation.Simulation */ abstract void flatten(MathSymbolTable simSymbolTable, boolean bRoundCoefficients) throws ExpressionException, MathException; /** * Insert the method's description here. * Creation date: (10/10/2002 10:31:03 AM) - * @param sim cbit.vcell.solver.Simulation + * @param sim cbit.vcell.solver.simulation.Simulation */ final void flatten0(MathSymbolTable simSymbolTable, boolean bRoundCoefficients) throws ExpressionException, MathException { @@ -146,7 +146,7 @@ public Expression getExactSolution() { /** * Insert the method's description here. * Creation date: (10/10/2002 10:31:03 AM) - * @param sim cbit.vcell.solver.Simulation + * @param sim cbit.vcell.solver.simulation.Simulation */ public final static Expression getFlattenedExpression(MathSymbolTable simSymbolTable, Expression exp, boolean bRoundCoefficients) throws ExpressionException, MathException { if (exp == null){ diff --git a/vcell-core/src/main/java/cbit/vcell/math/FilamentRegionEquation.java b/vcell-core/src/main/java/cbit/vcell/math/FilamentRegionEquation.java index 104c68e858..cd4ad7412a 100644 --- a/vcell-core/src/main/java/cbit/vcell/math/FilamentRegionEquation.java +++ b/vcell-core/src/main/java/cbit/vcell/math/FilamentRegionEquation.java @@ -63,7 +63,7 @@ public boolean compareEqual(Matchable object) { /** * Insert the method's description here. * Creation date: (10/10/2002 10:41:10 AM) - * @param sim cbit.vcell.solver.Simulation + * @param sim cbit.vcell.solver.simulation.Simulation */ void flatten(MathSymbolTable simSymbolTable, boolean bRoundCoefficients) throws cbit.vcell.parser.ExpressionException, MathException { super.flatten0(simSymbolTable,bRoundCoefficients); diff --git a/vcell-core/src/main/java/cbit/vcell/math/JumpCondition.java b/vcell-core/src/main/java/cbit/vcell/math/JumpCondition.java index 49a4853b5c..46d17695e9 100644 --- a/vcell-core/src/main/java/cbit/vcell/math/JumpCondition.java +++ b/vcell-core/src/main/java/cbit/vcell/math/JumpCondition.java @@ -70,7 +70,7 @@ public boolean compareEqual(Matchable object) { /** * Insert the method's description here. * Creation date: (10/10/2002 10:41:10 AM) - * @param sim cbit.vcell.solver.Simulation + * @param sim cbit.vcell.solver.simulation.Simulation */ void flatten(MathSymbolTable simSymbolTable, boolean bRoundCoefficients) throws cbit.vcell.parser.ExpressionException, MathException { super.flatten0(simSymbolTable,bRoundCoefficients); diff --git a/vcell-core/src/main/java/cbit/vcell/math/MathUtilities.java b/vcell-core/src/main/java/cbit/vcell/math/MathUtilities.java index fd5fbbfd27..a114ed0c1f 100644 --- a/vcell-core/src/main/java/cbit/vcell/math/MathUtilities.java +++ b/vcell-core/src/main/java/cbit/vcell/math/MathUtilities.java @@ -11,7 +11,7 @@ package cbit.vcell.math; import cbit.vcell.parser.*; -import cbit.vcell.solver.SimulationSymbolTable; +import cbit.vcell.solver.simulation.SimulationSymbolTable; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; diff --git a/vcell-core/src/main/java/cbit/vcell/math/MembraneRegionEquation.java b/vcell-core/src/main/java/cbit/vcell/math/MembraneRegionEquation.java index bc4be344fc..044c77a3e9 100644 --- a/vcell-core/src/main/java/cbit/vcell/math/MembraneRegionEquation.java +++ b/vcell-core/src/main/java/cbit/vcell/math/MembraneRegionEquation.java @@ -69,7 +69,7 @@ public boolean compareEqual(Matchable object) { /** * Insert the method's description here. * Creation date: (10/10/2002 10:41:10 AM) - * @param sim cbit.vcell.solver.Simulation + * @param sim cbit.vcell.solver.simulation.Simulation */ void flatten(MathSymbolTable simSymbolTable, boolean bRoundCoefficients) throws cbit.vcell.parser.ExpressionException, MathException { super.flatten0(simSymbolTable,bRoundCoefficients); diff --git a/vcell-core/src/main/java/cbit/vcell/math/OdeEquation.java b/vcell-core/src/main/java/cbit/vcell/math/OdeEquation.java index bac1e65150..7265ccaa09 100644 --- a/vcell-core/src/main/java/cbit/vcell/math/OdeEquation.java +++ b/vcell-core/src/main/java/cbit/vcell/math/OdeEquation.java @@ -59,7 +59,7 @@ public boolean compareEqual(Matchable object) { /** * Insert the method's description here. * Creation date: (10/10/2002 10:41:10 AM) - * @param sim cbit.vcell.solver.Simulation + * @param sim cbit.vcell.solver.simulation.Simulation */ void flatten(MathSymbolTable simSymbolTable, boolean bRoundCoefficients) throws cbit.vcell.parser.ExpressionException, MathException { super.flatten0(simSymbolTable,bRoundCoefficients); diff --git a/vcell-core/src/main/java/cbit/vcell/math/PdeEquation.java b/vcell-core/src/main/java/cbit/vcell/math/PdeEquation.java index e5a7e33ae2..3102af21b5 100644 --- a/vcell-core/src/main/java/cbit/vcell/math/PdeEquation.java +++ b/vcell-core/src/main/java/cbit/vcell/math/PdeEquation.java @@ -192,7 +192,7 @@ public boolean compareEqual(Matchable object) { /** * Insert the method's description here. * Creation date: (10/10/2002 10:41:10 AM) - * @param simSymbolTable cbit.vcell.solver.Simulation + * @param simSymbolTable cbit.vcell.solver.simulation.Simulation */ void flatten(MathSymbolTable simSymbolTable, boolean bRoundCoefficients) throws cbit.vcell.parser.ExpressionException, MathException { super.flatten0(simSymbolTable,bRoundCoefficients); diff --git a/vcell-core/src/main/java/cbit/vcell/mathmodel/MathModel.java b/vcell-core/src/main/java/cbit/vcell/mathmodel/MathModel.java index bf3965f567..212dcceb03 100644 --- a/vcell-core/src/main/java/cbit/vcell/mathmodel/MathModel.java +++ b/vcell-core/src/main/java/cbit/vcell/mathmodel/MathModel.java @@ -17,6 +17,8 @@ import java.util.List; import cbit.vcell.solver.*; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationOwner; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.vcell.util.*; @@ -547,7 +549,7 @@ public void setName(java.lang.String name) throws java.beans.PropertyVetoExcepti /** - * Sets the simulations property (cbit.vcell.solver.Simulation[]) value. + * Sets the simulations property (cbit.vcell.solver.simulation.Simulation[]) value. * * @param simulations The new value for the property. * @throws java.beans.PropertyVetoException The exception description. diff --git a/vcell-core/src/main/java/cbit/vcell/matlab/MatlabOdeFileCoder.java b/vcell-core/src/main/java/cbit/vcell/matlab/MatlabOdeFileCoder.java index e14e15f8b0..97436deef9 100644 --- a/vcell-core/src/main/java/cbit/vcell/matlab/MatlabOdeFileCoder.java +++ b/vcell-core/src/main/java/cbit/vcell/matlab/MatlabOdeFileCoder.java @@ -15,8 +15,6 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.vcell.util.ArrayUtils; -import org.vcell.util.BeanUtils; import cbit.vcell.math.CompartmentSubDomain; import cbit.vcell.math.Constant; @@ -32,8 +30,8 @@ import cbit.vcell.parser.ExpressionException; import cbit.vcell.solver.AnnotatedFunction; import cbit.vcell.solver.OutputFunctionContext; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationSymbolTable; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationSymbolTable; /** * Insert the type's description here. diff --git a/vcell-core/src/main/java/cbit/vcell/message/messages/SimulationTaskMessage.java b/vcell-core/src/main/java/cbit/vcell/message/messages/SimulationTaskMessage.java index 8bf53b79a9..000113961a 100644 --- a/vcell-core/src/main/java/cbit/vcell/message/messages/SimulationTaskMessage.java +++ b/vcell-core/src/main/java/cbit/vcell/message/messages/SimulationTaskMessage.java @@ -17,15 +17,15 @@ import cbit.vcell.message.VCMessagingConstants; import cbit.vcell.message.VCMessagingException; import cbit.vcell.message.VCellQueue; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.parser.ExpressionException; import cbit.vcell.xml.XmlHelper; import cbit.vcell.xml.XmlParseException; public class SimulationTaskMessage { - private SimulationTask simTask = null; + private StandardSimulationTask simTask = null; -public SimulationTaskMessage(SimulationTask simTask0) { +public SimulationTaskMessage(StandardSimulationTask simTask0) { super(); simTask = simTask0; } @@ -34,7 +34,7 @@ public SimulationTaskMessage(VCMessage message) throws XmlParseException { parse(message); } -public SimulationTask getSimulationTask() { +public StandardSimulationTask getSimulationTask() { return simTask; } diff --git a/vcell-core/src/main/java/cbit/vcell/message/messages/WorkerEventMessage.java b/vcell-core/src/main/java/cbit/vcell/message/messages/WorkerEventMessage.java index a55572ae37..038dcc058c 100644 --- a/vcell-core/src/main/java/cbit/vcell/message/messages/WorkerEventMessage.java +++ b/vcell-core/src/main/java/cbit/vcell/message/messages/WorkerEventMessage.java @@ -21,7 +21,7 @@ import cbit.vcell.message.VCMessagingConstants; import cbit.vcell.message.VCMessagingException; import cbit.vcell.message.VCellQueue; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.mongodb.VCMongoMessage; import cbit.vcell.mongodb.VCMongoMessage.ServiceName; import cbit.vcell.server.HtcJobID; @@ -197,7 +197,7 @@ private void parseMessage(UserResolver userResolver, VCMessage message) throws D * @param param javax.jms.Message * @throws VCMessagingException */ -public static WorkerEventMessage sendAccepted(VCMessageSession session, Object source, SimulationTask simTask, String hostName, HtcJobID htcJobID) throws VCMessagingException { +public static WorkerEventMessage sendAccepted(VCMessageSession session, Object source, StandardSimulationTask simTask, String hostName, HtcJobID htcJobID) throws VCMessagingException { WorkerEvent workerEvent = new WorkerEvent(WorkerEvent.JOB_ACCEPTED, source, simTask, hostName, SimulationMessage.MESSAGE_JOB_ACCEPTED); workerEvent.setHtcJobID(htcJobID); WorkerEventMessage workerEventMessage = new WorkerEventMessage(workerEvent); @@ -212,7 +212,7 @@ public static WorkerEventMessage sendAccepted(VCMessageSession session, Object s * Creation date: (12/31/2003 12:53:34 PM) * @param param javax.jms.Message */ -public static WorkerEventMessage sendCompleted(VCMessageSession session, Object source, SimulationTask simTask, String hostName, double progress, double timePoint, SimulationMessage simulationMessage) throws VCMessagingException { +public static WorkerEventMessage sendCompleted(VCMessageSession session, Object source, StandardSimulationTask simTask, String hostName, double progress, double timePoint, SimulationMessage simulationMessage) throws VCMessagingException { WorkerEvent workerEvent = new WorkerEvent(WorkerEvent.JOB_COMPLETED, source, simTask, hostName, new Double(progress), new Double(timePoint), simulationMessage); WorkerEventMessage workerEventMessage = new WorkerEventMessage(workerEvent); workerEventMessage.sendWorkerEvent(session); @@ -232,7 +232,7 @@ public static WorkerEventMessage sendAlternateCompleted(VCMessageSession session * Creation date: (12/31/2003 12:53:34 PM) * @param param javax.jms.Message */ -public static WorkerEventMessage sendFailed(VCMessageSession session, Object source, SimulationTask simTask, String hostName, SimulationMessage failMessage) throws VCMessagingException { +public static WorkerEventMessage sendFailed(VCMessageSession session, Object source, StandardSimulationTask simTask, String hostName, SimulationMessage failMessage) throws VCMessagingException { WorkerEvent workerEvent = new WorkerEvent(WorkerEvent.JOB_FAILURE, source, simTask, hostName, failMessage); WorkerEventMessage workerEventMessage = new WorkerEventMessage(workerEvent); workerEventMessage.sendWorkerEvent(session); @@ -246,7 +246,7 @@ public static WorkerEventMessage sendFailed(VCMessageSession session, Object sou * Creation date: (12/31/2003 12:53:34 PM) * @param param javax.jms.Message */ -public static WorkerEventMessage sendNewData(VCMessageSession session, Object source, SimulationTask simTask, String hostName, double progress, double timePoint, SimulationMessage simulationMessage) throws VCMessagingException { +public static WorkerEventMessage sendNewData(VCMessageSession session, Object source, StandardSimulationTask simTask, String hostName, double progress, double timePoint, SimulationMessage simulationMessage) throws VCMessagingException { WorkerEvent workerEvent = new WorkerEvent(WorkerEvent.JOB_DATA, source, simTask, hostName, new Double(progress), new Double(timePoint), simulationMessage); WorkerEventMessage workerEventMessage = new WorkerEventMessage(workerEvent); workerEventMessage.sendWorkerEvent(session); @@ -260,7 +260,7 @@ public static WorkerEventMessage sendNewData(VCMessageSession session, Object so * Creation date: (12/31/2003 12:53:34 PM) * @param param javax.jms.Message */ -public static WorkerEventMessage sendProgress(VCMessageSession session, Object source, SimulationTask simTask, String hostName, double progress, double timePoint, SimulationMessage simulationMessage) throws VCMessagingException { +public static WorkerEventMessage sendProgress(VCMessageSession session, Object source, StandardSimulationTask simTask, String hostName, double progress, double timePoint, SimulationMessage simulationMessage) throws VCMessagingException { WorkerEvent workerEvent = new WorkerEvent(WorkerEvent.JOB_PROGRESS, source, simTask, hostName, new Double(progress), new Double(timePoint), simulationMessage); WorkerEventMessage workerEventMessage = new WorkerEventMessage(workerEvent); workerEventMessage.sendWorkerEvent(session); @@ -274,7 +274,7 @@ public static WorkerEventMessage sendProgress(VCMessageSession session, Object s * Creation date: (12/31/2003 12:53:34 PM) * @param param javax.jms.Message */ -public static WorkerEventMessage sendStarting(VCMessageSession session, Object source, SimulationTask simTask, String hostName, SimulationMessage startMessage) throws VCMessagingException { +public static WorkerEventMessage sendStarting(VCMessageSession session, Object source, StandardSimulationTask simTask, String hostName, SimulationMessage startMessage) throws VCMessagingException { WorkerEvent workerEvent = new WorkerEvent(WorkerEvent.JOB_STARTING, source, simTask, hostName, startMessage); WorkerEventMessage workerEventMessage = new WorkerEventMessage(workerEvent); workerEventMessage.sendWorkerEvent(session); @@ -288,7 +288,7 @@ public static WorkerEventMessage sendStarting(VCMessageSession session, Object s * Creation date: (12/31/2003 12:53:34 PM) * @param param javax.jms.Message */ -public static WorkerEventMessage sendWorkerAlive(VCMessageSession session, Object source, SimulationTask simTask, String hostName, SimulationMessage simulationMessage) throws VCMessagingException { +public static WorkerEventMessage sendWorkerAlive(VCMessageSession session, Object source, StandardSimulationTask simTask, String hostName, SimulationMessage simulationMessage) throws VCMessagingException { WorkerEvent workerEvent = new WorkerEvent(WorkerEvent.JOB_WORKER_ALIVE, source, simTask, hostName, simulationMessage); WorkerEventMessage workerEventMessage = new WorkerEventMessage(workerEvent); workerEventMessage.sendWorkerEvent(session); diff --git a/vcell-core/src/main/java/cbit/vcell/message/server/bootstrap/client/LocalDataSetControllerMessaging.java b/vcell-core/src/main/java/cbit/vcell/message/server/bootstrap/client/LocalDataSetControllerMessaging.java index ed7b315852..7c5da16ea2 100644 --- a/vcell-core/src/main/java/cbit/vcell/message/server/bootstrap/client/LocalDataSetControllerMessaging.java +++ b/vcell-core/src/main/java/cbit/vcell/message/server/bootstrap/client/LocalDataSetControllerMessaging.java @@ -272,7 +272,7 @@ public org.vcell.util.document.TimeSeriesJobResults getTimeSeriesValues(OutputCo /** * This method was created in VisualAge. - * @param simInfo cbit.vcell.solver.SimulationInfo + * @param simInfo cbit.vcell.solver.simulation.SimulationInfo * @exception org.vcell.util.DataAccessException The exception description. * @throws RemoteProxyException */ diff --git a/vcell-core/src/main/java/cbit/vcell/messaging/server/SimulationTask.java b/vcell-core/src/main/java/cbit/vcell/messaging/server/SimulationTask.java index 8a49733df2..47fdd21ec2 100644 --- a/vcell-core/src/main/java/cbit/vcell/messaging/server/SimulationTask.java +++ b/vcell-core/src/main/java/cbit/vcell/messaging/server/SimulationTask.java @@ -1,211 +1,35 @@ -/* - * Copyright (C) 1999-2011 University of Connecticut Health Center - * - * Licensed under the MIT License (the "License"). - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.opensource.org/licenses/mit-license.php - */ - -package cbit.vcell.messaging.server; -import org.vcell.util.Compare; -import org.vcell.util.ISize; -import org.vcell.util.Matchable; -import org.vcell.util.document.KeyValue; -import org.vcell.util.document.User; - -import cbit.vcell.math.MathDescription; -import cbit.vcell.math.MemVariable; -import cbit.vcell.math.Variable; -import cbit.vcell.math.VolVariable; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationInfo; -import cbit.vcell.solver.SimulationJob; -import cbit.vcell.solver.SimulationSymbolTable; -import cbit.vcell.solver.SolverDescription; - -/** - * Insert the type's description here. - * Creation date: (10/24/2001 10:44:09 PM) - * @author: Jim Schaff - */ -public class SimulationTask implements java.io.Serializable, Matchable { - private SimulationJob simulationJob = null; - private int taskID = 0; - private String computeResource = null; - private boolean isPowerUser = false; -/** - * SimulationTask constructor comment. - * @param argName java.lang.String - * @param argEstimatedSizeMB double - * @param argEstimatedTimeSec double - * @param argUserid java.lang.String - */ -public SimulationTask(SimulationJob argSimulationJob, int tid) { - this(argSimulationJob, tid, null,false); -} - -public SimulationTask(SimulationJob argSimulationJob, int tid, String comres, boolean isPowerUser) { - if (argSimulationJob == null || argSimulationJob.getSimulation() == null){ - throw new RuntimeException("simulation cannot be null"); - } - simulationJob = argSimulationJob; - taskID = tid; - computeResource = comres; - this.isPowerUser = isPowerUser; -} - -public boolean isPowerUser() { - return isPowerUser; -} -public double getEstimatedMemorySizeMB() { - // - // calculate number of PDE variables and total number of spatial variables - // - SimulationSymbolTable simSymbolTable = getSimulationJob().getSimulationSymbolTable(); - Simulation simulation = simSymbolTable.getSimulation(); - MathDescription mathDescription = simulation.getMathDescription(); - - int pdeVarCount=0; - int odeVarCount=0; - Variable variables[] = simSymbolTable.getVariables(); - for (int i=0;i>"); SimulationData.SimDataAmplistorInfo simDataAmplistorInfo = AmplistorUtils.getSimDataAmplistorInfoFromPropertyLoader(); vcData = new SimulationData(vcdID, getPrimaryUserDir(vcdID.getOwner(), false), getSecondaryUserDir(vcdID.getOwner()),simDataAmplistorInfo); diff --git a/vcell-core/src/main/java/cbit/vcell/simdata/MembraneDataInfo.java b/vcell-core/src/main/java/cbit/vcell/simdata/MembraneDataInfo.java index 7c43f36bdf..1bdda9bfce 100644 --- a/vcell-core/src/main/java/cbit/vcell/simdata/MembraneDataInfo.java +++ b/vcell-core/src/main/java/cbit/vcell/simdata/MembraneDataInfo.java @@ -1,6 +1,6 @@ package cbit.vcell.simdata; -import cbit.vcell.solver.SimulationModelInfo; +import cbit.vcell.solver.simulation.SimulationModelInfo; import cbit.vcell.solvers.CartesianMesh; import cbit.vcell.solvers.MembraneElement; diff --git a/vcell-core/src/main/java/cbit/vcell/simdata/ODEDataManager.java b/vcell-core/src/main/java/cbit/vcell/simdata/ODEDataManager.java index 8992a6382e..11b832f781 100644 --- a/vcell-core/src/main/java/cbit/vcell/simdata/ODEDataManager.java +++ b/vcell-core/src/main/java/cbit/vcell/simdata/ODEDataManager.java @@ -138,7 +138,7 @@ public NFSimMolecularConfigurations getNFSimMolecularConfigurations() throws Dat } /** - * Gets the simulationInfo property (cbit.vcell.solver.SimulationInfo) value. + * Gets the simulationInfo property (cbit.vcell.solver.simulation.SimulationInfo) value. * @return The simulationInfo property value. */ public VCDataIdentifier getVCDataIdentifier() { diff --git a/vcell-core/src/main/java/cbit/vcell/simdata/PDEDataManager.java b/vcell-core/src/main/java/cbit/vcell/simdata/PDEDataManager.java index 677f77bcdb..a9410fa86c 100644 --- a/vcell-core/src/main/java/cbit/vcell/simdata/PDEDataManager.java +++ b/vcell-core/src/main/java/cbit/vcell/simdata/PDEDataManager.java @@ -214,7 +214,7 @@ private VCDataIdentifier getVcDataIdentifier() { /** - * Gets the simulationInfo property (cbit.vcell.solver.SimulationInfo) value. + * Gets the simulationInfo property (cbit.vcell.solver.simulation.SimulationInfo) value. * @return The simulationInfo property value. */ public VCDataIdentifier getVCDataIdentifier() { diff --git a/vcell-core/src/main/java/cbit/vcell/simdata/SimulationData.java b/vcell-core/src/main/java/cbit/vcell/simdata/SimulationData.java index 3074d6ca63..01b1d2bbe1 100644 --- a/vcell-core/src/main/java/cbit/vcell/simdata/SimulationData.java +++ b/vcell-core/src/main/java/cbit/vcell/simdata/SimulationData.java @@ -76,7 +76,7 @@ import cbit.vcell.math.Variable.Domain; import cbit.vcell.math.VariableType; import cbit.vcell.math.VolVariable; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.mongodb.VCMongoMessage; import cbit.vcell.parser.Expression; import cbit.vcell.parser.ExpressionException; @@ -88,8 +88,8 @@ import cbit.vcell.simdata.DataOperationResults.DataProcessingOutputDataValues; import cbit.vcell.simdata.DataOperationResults.DataProcessingOutputInfo; import cbit.vcell.solver.AnnotatedFunction; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationJob; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationJob; import cbit.vcell.solver.SolverUtilities; import cbit.vcell.solver.VCSimulationDataIdentifier; import cbit.vcell.solver.VCSimulationDataIdentifierOldStyle; @@ -1679,7 +1679,7 @@ public synchronized DataIdentifier[] getVarAndFunctionDataIdentifiers(OutputCont if (comsolSimFiles.simTaskXMLFile!=null){ try { String xmlString = FileUtils.readFileToString(comsolSimFiles.simTaskXMLFile); - SimulationTask simTask = XmlHelper.XMLToSimTask(xmlString); + StandardSimulationTask simTask = XmlHelper.XMLToSimTask(xmlString); Enumeration variablesEnum = simTask.getSimulation().getMathDescription().getVariables(); while (variablesEnum.hasMoreElements()){ Variable var = variablesEnum.nextElement(); @@ -2442,7 +2442,7 @@ public ChomboFiles getChomboFiles() throws IOException, XmlParseException, Expre throw new RuntimeException("Chombo dataset mission .simtask.xml file, please rerun"); } String xmlString = FileUtils.readFileToString(simtaskFile); - SimulationTask simTask = XmlHelper.XMLToSimTask(xmlString); + StandardSimulationTask simTask = XmlHelper.XMLToSimTask(xmlString); if (!simTask.getSimulation().getSolverTaskDescription().getChomboSolverSpec().isSaveChomboOutput() && !simTask.getSimulation().getSolverTaskDescription().isParallel()){ throw new RuntimeException("Export of Chombo simulations to VTK requires chombo data, select 'Chombo' data format in simulation solver options and rerun simulation."); diff --git a/vcell-core/src/main/java/cbit/vcell/simdata/VolumeDataInfo.java b/vcell-core/src/main/java/cbit/vcell/simdata/VolumeDataInfo.java index 368b0d4f11..1e5596dc93 100644 --- a/vcell-core/src/main/java/cbit/vcell/simdata/VolumeDataInfo.java +++ b/vcell-core/src/main/java/cbit/vcell/simdata/VolumeDataInfo.java @@ -1,6 +1,6 @@ package cbit.vcell.simdata; -import cbit.vcell.solver.SimulationModelInfo; +import cbit.vcell.solver.simulation.SimulationModelInfo; import cbit.vcell.solvers.CartesianMesh; public class VolumeDataInfo{ diff --git a/vcell-core/src/main/java/cbit/vcell/solver/DataSymbolMetadata.java b/vcell-core/src/main/java/cbit/vcell/solver/DataSymbolMetadata.java index 9fdda554c2..76c6eeec21 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/DataSymbolMetadata.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/DataSymbolMetadata.java @@ -1,6 +1,6 @@ package cbit.vcell.solver; -import cbit.vcell.solver.SimulationModelInfo.ModelCategoryType; +import cbit.vcell.solver.simulation.SimulationModelInfo.ModelCategoryType; import cbit.vcell.units.VCUnitDefinition; public class DataSymbolMetadata { diff --git a/vcell-core/src/main/java/cbit/vcell/solver/DefaultOutputTimeSpec.java b/vcell-core/src/main/java/cbit/vcell/solver/DefaultOutputTimeSpec.java index 580d6eb831..a3231c3b0d 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/DefaultOutputTimeSpec.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/DefaultOutputTimeSpec.java @@ -10,7 +10,7 @@ package cbit.vcell.solver; import cbit.vcell.math.VCML; -import cbit.vcell.solver.SimulationOwner.UnitInfo; +import cbit.vcell.solver.simulation.SimulationOwner.UnitInfo; /** * Insert the type's description here. diff --git a/vcell-core/src/main/java/cbit/vcell/solver/ExplicitOutputTimeSpec.java b/vcell-core/src/main/java/cbit/vcell/solver/ExplicitOutputTimeSpec.java index 0b16d143aa..d68d342a7d 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/ExplicitOutputTimeSpec.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/ExplicitOutputTimeSpec.java @@ -12,7 +12,7 @@ import java.util.Objects; import cbit.vcell.math.VCML; -import cbit.vcell.solver.SimulationOwner.UnitInfo; +import cbit.vcell.solver.simulation.SimulationOwner.UnitInfo; /** * Insert the type's description here. diff --git a/vcell-core/src/main/java/cbit/vcell/solver/MathOverrides.java b/vcell-core/src/main/java/cbit/vcell/solver/MathOverrides.java index 89e6b2cb88..7c7fd2b622 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/MathOverrides.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/MathOverrides.java @@ -14,7 +14,8 @@ import cbit.vcell.math.*; import cbit.vcell.model.common.VCellErrorMessages; import cbit.vcell.parser.*; -import jscl.math.function.Exp; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationOwner; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.vcell.util.*; @@ -22,7 +23,6 @@ import org.vcell.util.IssueContext.ContextType; import java.util.*; -import java.util.function.BiPredicate; import java.util.function.Function; import java.util.stream.Collectors; @@ -504,7 +504,7 @@ public String[] getScannedConstantNames(){ * Insert the method's description here. * Creation date: (9/30/2004 8:48:43 PM) * - * @return cbit.vcell.solver.Simulation + * @return cbit.vcell.solver.simulation.Simulation */ public Simulation getSimulation(){ return simulation; @@ -818,9 +818,9 @@ public void removeMathOverridesListener(MathOverridesListener newListener){ * Insert the method's description here. * Creation date: (9/30/2004 8:48:43 PM) * - * @param newSimulation cbit.vcell.solver.Simulation + * @param newSimulation cbit.vcell.solver.simulation.Simulation */ - void setSimulation(Simulation newSimulation){ + public void setSimulation(Simulation newSimulation){ simulation = newSimulation; } @@ -833,7 +833,7 @@ private static Vector toVector(java.util.Enumeration enumerati return (vector); } - void updateFromMathDescription(boolean bTransformUnits){ + public void updateFromMathDescription(boolean bTransformUnits){ MathDescription mathDescription = getSimulation().getMathDescription(); // // get list of names of constants in this math diff --git a/vcell-core/src/main/java/cbit/vcell/solver/OutputFunctionContext.java b/vcell-core/src/main/java/cbit/vcell/solver/OutputFunctionContext.java index 68424b2664..6015b8e297 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/OutputFunctionContext.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/OutputFunctionContext.java @@ -22,6 +22,8 @@ import java.util.Map; import java.util.Vector; +import cbit.vcell.solver.simulation.SimulationOwner; +import cbit.vcell.solver.simulation.SimulationSymbolTable; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.vcell.util.Compare; @@ -216,7 +218,7 @@ public void propertyChange(java.beans.PropertyChangeEvent event) { } // check with flattened expression to find out the variable type of the new expression Function flattenedFunction = new Function(function.getName(), newexp, function.getDomain()); - newFuncType = SimulationSymbolTable.getFunctionVariableType(flattenedFunction, getSimulationOwner().getMathDescription(), symbols, varTypes, true); + newFuncType = SimulationSymbolTable.getFunctionVariableType(flattenedFunction, getSimulationOwner().getMathDescription(), symbols, varTypes, true); } AnnotatedFunction newFunc = new AnnotatedFunction(function.getName(), function.getExpression(), function.getDomain(), "", newFuncType, FunctionCategory.OUTPUTFUNCTION); newFuncList.add(newFunc); diff --git a/vcell-core/src/main/java/cbit/vcell/solver/OutputTimeSpec.java b/vcell-core/src/main/java/cbit/vcell/solver/OutputTimeSpec.java index 9fcbc0b8dd..f7a6b1093c 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/OutputTimeSpec.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/OutputTimeSpec.java @@ -9,6 +9,7 @@ */ package cbit.vcell.solver; +import cbit.vcell.solver.simulation.SimulationOwner; import org.vcell.util.CommentStringTokenizer; import org.vcell.util.DataAccessException; diff --git a/vcell-core/src/main/java/cbit/vcell/solver/SolverTaskDescription.java b/vcell-core/src/main/java/cbit/vcell/solver/SolverTaskDescription.java index 3eb27ac390..81d28f0de0 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/SolverTaskDescription.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/SolverTaskDescription.java @@ -14,14 +14,13 @@ import java.util.Collection; import java.util.Objects; +import cbit.vcell.solver.simulation.Simulation; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.vcell.chombo.ChomboSolverSpec; import org.vcell.chombo.TimeInterval; import org.vcell.util.*; -import cbit.vcell.mapping.SimulationContext; -import cbit.vcell.mapping.SimulationContext.Application; import cbit.vcell.math.Constant; import cbit.vcell.math.MathDescription; import cbit.vcell.math.MathFunctionDefinitions; diff --git a/vcell-core/src/main/java/cbit/vcell/solver/TempSimulation.java b/vcell-core/src/main/java/cbit/vcell/solver/TempSimulation.java index 74983e0495..937b57964c 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/TempSimulation.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/TempSimulation.java @@ -2,6 +2,8 @@ import java.util.TreeMap; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationInfo; import org.vcell.util.document.SimulationVersion; import org.vcell.util.document.VCellSoftwareVersion; import org.vcell.util.document.Version; diff --git a/vcell-core/src/main/java/cbit/vcell/solver/UniformOutputTimeSpec.java b/vcell-core/src/main/java/cbit/vcell/solver/UniformOutputTimeSpec.java index dfc94df748..6e7b649b85 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/UniformOutputTimeSpec.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/UniformOutputTimeSpec.java @@ -14,7 +14,7 @@ import org.vcell.util.Matchable; import cbit.vcell.math.VCML; -import cbit.vcell.solver.SimulationOwner.UnitInfo; +import cbit.vcell.solver.simulation.SimulationOwner.UnitInfo; /** * Insert the type's description here. diff --git a/vcell-core/src/main/java/cbit/vcell/solver/VCSimulationDataIdentifier.java b/vcell-core/src/main/java/cbit/vcell/solver/VCSimulationDataIdentifier.java index 038c0aa403..db9ae24684 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/VCSimulationDataIdentifier.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/VCSimulationDataIdentifier.java @@ -10,6 +10,8 @@ package cbit.vcell.solver; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationJob; import org.vcell.util.document.KeyValue; import org.vcell.util.document.SimResampleInfoProvider; diff --git a/vcell-core/src/main/java/cbit/vcell/solver/VCSimulationDataIdentifierOldStyle.java b/vcell-core/src/main/java/cbit/vcell/solver/VCSimulationDataIdentifierOldStyle.java index f29cd34bd7..0db30b154e 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/VCSimulationDataIdentifierOldStyle.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/VCSimulationDataIdentifierOldStyle.java @@ -10,6 +10,7 @@ package cbit.vcell.solver; +import cbit.vcell.solver.simulation.Simulation; import org.vcell.util.document.KeyValue; import org.vcell.util.document.SimResampleInfoProvider; diff --git a/vcell-core/src/main/java/cbit/vcell/solver/VCSimulationIdentifier.java b/vcell-core/src/main/java/cbit/vcell/solver/VCSimulationIdentifier.java index 003a54f109..bf638a72d8 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/VCSimulationIdentifier.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/VCSimulationIdentifier.java @@ -9,6 +9,9 @@ */ package cbit.vcell.solver; + +import cbit.vcell.solver.simulation.Simulation; + /** * Insert the type's description here. * Creation date: (8/24/2004 10:55:36 AM) diff --git a/vcell-core/src/main/java/cbit/vcell/solver/ode/AbstractJavaSolver.java b/vcell-core/src/main/java/cbit/vcell/solver/ode/AbstractJavaSolver.java index 524c984f5a..59c938b337 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/ode/AbstractJavaSolver.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/ode/AbstractJavaSolver.java @@ -12,10 +12,10 @@ import java.io.File; import java.io.IOException; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.solver.DefaultOutputTimeSpec; import cbit.vcell.solver.OutputTimeSpec; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; import cbit.vcell.solver.SolverException; import cbit.vcell.solver.UserStopException; import cbit.vcell.solver.VCSimulationDataIdentifier; @@ -41,7 +41,7 @@ public abstract class AbstractJavaSolver extends AbstractSolver { /** * AbstractIntegrator constructor comment. */ -public AbstractJavaSolver(SimulationTask simTask, File directory) throws SolverException { +public AbstractJavaSolver(StandardSimulationTask simTask, File directory) throws SolverException { super(simTask, directory); } diff --git a/vcell-core/src/main/java/cbit/vcell/solver/ode/AdamsMoultonFiveSolver.java b/vcell-core/src/main/java/cbit/vcell/solver/ode/AdamsMoultonFiveSolver.java index 8c438f52d1..e5729b8698 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/ode/AdamsMoultonFiveSolver.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/ode/AdamsMoultonFiveSolver.java @@ -14,7 +14,7 @@ import java.io.IOException; import cbit.vcell.math.MathException; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.parser.ExpressionException; import cbit.vcell.solver.DefaultOutputTimeSpec; import cbit.vcell.solver.SolverException; @@ -34,7 +34,7 @@ public class AdamsMoultonFiveSolver extends AdamsSolver { * @param valueVectorCount int * @param temporaryVectorCount int */ -public AdamsMoultonFiveSolver(SimulationTask simTask, File directory) throws SolverException { +public AdamsMoultonFiveSolver(StandardSimulationTask simTask, File directory) throws SolverException { super(simTask, directory, 2, 5); } protected void initialize() throws SolverException { diff --git a/vcell-core/src/main/java/cbit/vcell/solver/ode/AdamsSolver.java b/vcell-core/src/main/java/cbit/vcell/solver/ode/AdamsSolver.java index dd507ffe10..4057877ef0 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/ode/AdamsSolver.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/ode/AdamsSolver.java @@ -12,7 +12,7 @@ import java.io.File; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.solver.SolverException; /** * Insert the class' description here. @@ -29,7 +29,7 @@ public abstract class AdamsSolver extends DefaultODESolver { * @param valueVectorCount int * @param temporaryVectorCount int */ -public AdamsSolver(SimulationTask simTask, File directory, int valueVectorCount, int workArrayCount) throws SolverException { +public AdamsSolver(StandardSimulationTask simTask, File directory, int valueVectorCount, int workArrayCount) throws SolverException { super(simTask, directory, valueVectorCount); fieldWorkArrayCount = workArrayCount; } diff --git a/vcell-core/src/main/java/cbit/vcell/solver/ode/CVodeFileWriter.java b/vcell-core/src/main/java/cbit/vcell/solver/ode/CVodeFileWriter.java index c5bdaa48b1..7c530c968f 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/ode/CVodeFileWriter.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/ode/CVodeFileWriter.java @@ -16,7 +16,7 @@ import cbit.vcell.math.MathException; import cbit.vcell.math.MathUtilities; import cbit.vcell.math.ReservedVariable; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.parser.Discontinuity; import cbit.vcell.parser.Expression; import cbit.vcell.parser.ExpressionException; @@ -28,11 +28,11 @@ */ public class CVodeFileWriter extends OdeFileWriter { -public CVodeFileWriter(PrintWriter pw, SimulationTask simTask) { +public CVodeFileWriter(PrintWriter pw, StandardSimulationTask simTask) { super(pw, simTask, false); } -public CVodeFileWriter(PrintWriter pw, SimulationTask simTask, boolean bUseMessaging) { +public CVodeFileWriter(PrintWriter pw, StandardSimulationTask simTask, boolean bUseMessaging) { super(pw, simTask, bUseMessaging); } diff --git a/vcell-core/src/main/java/cbit/vcell/solver/ode/CVodeSolverStandalone.java b/vcell-core/src/main/java/cbit/vcell/solver/ode/CVodeSolverStandalone.java index d72e649f75..6d7ce7ac73 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/ode/CVodeSolverStandalone.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/ode/CVodeSolverStandalone.java @@ -13,7 +13,7 @@ import java.io.IOException; import java.io.PrintWriter; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.solver.SolverDescription; import cbit.vcell.solver.SolverException; import cbit.vcell.solver.SolverUtilities; @@ -27,7 +27,7 @@ */ public class CVodeSolverStandalone extends SundialsSolver { - public CVodeSolverStandalone(SimulationTask simTask, java.io.File directory, boolean bMessaging) throws SolverException { + public CVodeSolverStandalone(StandardSimulationTask simTask, java.io.File directory, boolean bMessaging) throws SolverException { super(simTask, directory, bMessaging); } /** diff --git a/vcell-core/src/main/java/cbit/vcell/solver/ode/DefaultODESolver.java b/vcell-core/src/main/java/cbit/vcell/solver/ode/DefaultODESolver.java index eb099e0fd5..f8e5d851ac 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/ode/DefaultODESolver.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/ode/DefaultODESolver.java @@ -29,12 +29,12 @@ import cbit.vcell.math.SubDomain; import cbit.vcell.math.Variable; import cbit.vcell.math.VolVariable; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.parser.Expression; import cbit.vcell.parser.ExpressionException; import cbit.vcell.solver.DefaultOutputTimeSpec; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationSymbolTable; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationSymbolTable; import cbit.vcell.solver.SolverException; import cbit.vcell.solver.SolverTaskDescription; import cbit.vcell.solver.TimeBounds; @@ -62,7 +62,7 @@ public abstract class DefaultODESolver extends AbstractJavaSolver implements ODE private transient RateSensitivity rateSensitivity = null; private transient Jacobian jacobian = null; - public DefaultODESolver(SimulationTask simTask, File directory, int valueVectorCount) throws SolverException{ + public DefaultODESolver(StandardSimulationTask simTask, File directory, int valueVectorCount) throws SolverException{ super(simTask, directory); if(simTask.getSimulation().isSpatial()){ throw new SolverException("Cannot use DefaultODESolver on spatial simulation"); diff --git a/vcell-core/src/main/java/cbit/vcell/solver/ode/ForwardEulerSolver.java b/vcell-core/src/main/java/cbit/vcell/solver/ode/ForwardEulerSolver.java index b8710a348a..1961d52631 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/ode/ForwardEulerSolver.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/ode/ForwardEulerSolver.java @@ -12,7 +12,7 @@ import java.io.File; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.parser.ExpressionException; import cbit.vcell.solver.SolverException; /** @@ -27,7 +27,7 @@ public class ForwardEulerSolver extends DefaultODESolver { * @param sessionLog cbit.vcell.server.SessionLog * @param numVectors int */ -public ForwardEulerSolver(SimulationTask simTask, File directory) throws SolverException { +public ForwardEulerSolver(StandardSimulationTask simTask, File directory) throws SolverException { super(simTask, directory, 2); } /** diff --git a/vcell-core/src/main/java/cbit/vcell/solver/ode/IDAFileWriter.java b/vcell-core/src/main/java/cbit/vcell/solver/ode/IDAFileWriter.java index 47ad7c63d8..b328ec6708 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/ode/IDAFileWriter.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/ode/IDAFileWriter.java @@ -28,13 +28,13 @@ import cbit.vcell.matrix.MatrixException; import cbit.vcell.matrix.RationalExp; import cbit.vcell.matrix.RationalExpMatrix; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.parser.Discontinuity; import cbit.vcell.parser.Expression; import cbit.vcell.parser.ExpressionException; import cbit.vcell.parser.RationalExpUtils; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationSymbolTable; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationSymbolTable; /** * Insert the type's description here. * Creation date: (3/8/00 10:29:24 PM) @@ -44,12 +44,12 @@ public class IDAFileWriter extends OdeFileWriter { /** * OdeFileCoder constructor comment. */ -public IDAFileWriter(PrintWriter pw, SimulationTask simTask) { +public IDAFileWriter(PrintWriter pw, StandardSimulationTask simTask) { this(pw, simTask, false); } -public IDAFileWriter(PrintWriter pw, SimulationTask simTask, boolean bUseMessaging) { +public IDAFileWriter(PrintWriter pw, StandardSimulationTask simTask, boolean bUseMessaging) { super(pw, simTask, bUseMessaging); } /** diff --git a/vcell-core/src/main/java/cbit/vcell/solver/ode/IDASolverStandalone.java b/vcell-core/src/main/java/cbit/vcell/solver/ode/IDASolverStandalone.java index 0866731962..e02834f006 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/ode/IDASolverStandalone.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/ode/IDASolverStandalone.java @@ -14,7 +14,7 @@ import java.io.IOException; import java.io.PrintWriter; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.solver.SolverDescription; import cbit.vcell.solver.SolverException; import cbit.vcell.solver.SolverUtilities; @@ -28,7 +28,7 @@ */ public class IDASolverStandalone extends SundialsSolver { -public IDASolverStandalone(SimulationTask simTask, File directory, boolean bMessaging) throws SolverException { +public IDASolverStandalone(StandardSimulationTask simTask, File directory, boolean bMessaging) throws SolverException { super(simTask, directory, bMessaging); } /** diff --git a/vcell-core/src/main/java/cbit/vcell/solver/ode/ODEStateVariable.java b/vcell-core/src/main/java/cbit/vcell/solver/ode/ODEStateVariable.java index 5e394a14e2..5890d1fdfd 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/ode/ODEStateVariable.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/ode/ODEStateVariable.java @@ -14,7 +14,7 @@ import cbit.vcell.math.OdeEquation; import cbit.vcell.parser.Expression; import cbit.vcell.parser.ExpressionException; -import cbit.vcell.solver.SimulationSymbolTable; +import cbit.vcell.solver.simulation.SimulationSymbolTable; /** * Insert the class' description here. * Creation date: (8/19/2000 8:59:44 PM) diff --git a/vcell-core/src/main/java/cbit/vcell/solver/ode/OdeFileWriter.java b/vcell-core/src/main/java/cbit/vcell/solver/ode/OdeFileWriter.java index d787c43bdf..cb70b33cf2 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/ode/OdeFileWriter.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/ode/OdeFileWriter.java @@ -29,7 +29,7 @@ import cbit.vcell.math.ReservedVariable; import cbit.vcell.math.Variable; import cbit.vcell.math.VolVariable; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.parser.Discontinuity; import cbit.vcell.parser.Expression; import cbit.vcell.parser.ExpressionException; @@ -39,8 +39,8 @@ import cbit.vcell.solver.ErrorTolerance; import cbit.vcell.solver.ExplicitOutputTimeSpec; import cbit.vcell.solver.OutputTimeSpec; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationSymbolTable; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationSymbolTable; import cbit.vcell.solver.SolverTaskDescription; import cbit.vcell.solver.TimeBounds; import cbit.vcell.solver.UniformOutputTimeSpec; @@ -60,7 +60,7 @@ public abstract class OdeFileWriter extends SolverFileWriter { /** * OdeFileCoder constructor comment. */ -public OdeFileWriter(PrintWriter pw, SimulationTask simTask, boolean messaging) { +public OdeFileWriter(PrintWriter pw, StandardSimulationTask simTask, boolean messaging) { super(pw, simTask, messaging); } diff --git a/vcell-core/src/main/java/cbit/vcell/solver/ode/RungeKuttaFehlbergSolver.java b/vcell-core/src/main/java/cbit/vcell/solver/ode/RungeKuttaFehlbergSolver.java index c1eefe4c92..d5994c8d20 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/ode/RungeKuttaFehlbergSolver.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/ode/RungeKuttaFehlbergSolver.java @@ -14,7 +14,7 @@ import java.io.IOException; import cbit.vcell.math.MathException; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.parser.ExpressionException; import cbit.vcell.solver.DefaultOutputTimeSpec; import cbit.vcell.solver.SolverException; @@ -38,7 +38,7 @@ public class RungeKuttaFehlbergSolver extends RungeKuttaSolver { private static double[] c = { 16.0/135.0, 0.0, 6656.0/12825.0, 28561.0/56430.0, -9.0/50.0, 2.0/55.0 }; private static double[] e = { -1.0/360.0, 0.0, 128.0/4275.0, 2197.0/75240.0, -1.0/50.0, -2.0/55.0 }; -public RungeKuttaFehlbergSolver(SimulationTask simTask, File directory) throws SolverException { +public RungeKuttaFehlbergSolver(StandardSimulationTask simTask, File directory) throws SolverException { super(simTask, directory, 3, 6); } public double calculateErrorTerm(int i) { diff --git a/vcell-core/src/main/java/cbit/vcell/solver/ode/RungeKuttaFourSolver.java b/vcell-core/src/main/java/cbit/vcell/solver/ode/RungeKuttaFourSolver.java index 8776de5377..302a68b51d 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/ode/RungeKuttaFourSolver.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/ode/RungeKuttaFourSolver.java @@ -12,7 +12,7 @@ import java.io.File; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.parser.ExpressionException; import cbit.vcell.solver.SolverException; /** @@ -27,7 +27,7 @@ public class RungeKuttaFourSolver extends RungeKuttaSolver { * @param sessionLog cbit.vcell.server.SessionLog * @param numVectors int */ -public RungeKuttaFourSolver(SimulationTask simTask, File directory) throws SolverException { +public RungeKuttaFourSolver(StandardSimulationTask simTask, File directory) throws SolverException { super(simTask, directory, 2, 4); } /** diff --git a/vcell-core/src/main/java/cbit/vcell/solver/ode/RungeKuttaSolver.java b/vcell-core/src/main/java/cbit/vcell/solver/ode/RungeKuttaSolver.java index 1f9f2b335e..c970f80864 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/ode/RungeKuttaSolver.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/ode/RungeKuttaSolver.java @@ -12,7 +12,7 @@ import java.io.File; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.solver.SolverException; /** * Insert the class' description here. @@ -29,7 +29,7 @@ public abstract class RungeKuttaSolver extends DefaultODESolver { * @param valueVectorCount int * @param temporaryVectorCount int */ -public RungeKuttaSolver(SimulationTask simTask, File directory, int valueVectorCount, int workArrayCount) throws SolverException { +public RungeKuttaSolver(StandardSimulationTask simTask, File directory, int valueVectorCount, int workArrayCount) throws SolverException { super(simTask, directory, valueVectorCount); fieldWorkArrayCount = workArrayCount; } diff --git a/vcell-core/src/main/java/cbit/vcell/solver/ode/RungeKuttaTwoSolver.java b/vcell-core/src/main/java/cbit/vcell/solver/ode/RungeKuttaTwoSolver.java index 2e2a8775a7..c85abb8f66 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/ode/RungeKuttaTwoSolver.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/ode/RungeKuttaTwoSolver.java @@ -12,7 +12,7 @@ import java.io.File; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.parser.ExpressionException; import cbit.vcell.solver.SolverException; /** @@ -27,7 +27,7 @@ public class RungeKuttaTwoSolver extends RungeKuttaSolver { * @param sessionLog cbit.vcell.server.SessionLog * @param numVectors int */ -public RungeKuttaTwoSolver(SimulationTask simTask, File directory) throws SolverException { +public RungeKuttaTwoSolver(StandardSimulationTask simTask, File directory) throws SolverException { super(simTask, directory, 2, 2); } /** diff --git a/vcell-core/src/main/java/cbit/vcell/solver/ode/SensStateVariable.java b/vcell-core/src/main/java/cbit/vcell/solver/ode/SensStateVariable.java index 1c086252a6..45132b8405 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/ode/SensStateVariable.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/ode/SensStateVariable.java @@ -18,7 +18,7 @@ import cbit.vcell.parser.Expression; import cbit.vcell.parser.ExpressionException; import cbit.vcell.parser.SymbolTable; -import cbit.vcell.solver.SimulationSymbolTable; +import cbit.vcell.solver.simulation.SimulationSymbolTable; /** * Insert the class' description here. * Creation date: (8/19/2000 9:00:20 PM) diff --git a/vcell-core/src/main/java/cbit/vcell/solver/ode/SundialsSolver.java b/vcell-core/src/main/java/cbit/vcell/solver/ode/SundialsSolver.java index 6d96b34831..75e46bd6de 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/ode/SundialsSolver.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/ode/SundialsSolver.java @@ -21,7 +21,6 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.vcell.util.BeanUtils; import cbit.vcell.math.Constant; import cbit.vcell.math.Equation; @@ -35,14 +34,14 @@ import cbit.vcell.math.Variable; import cbit.vcell.math.VariableType; import cbit.vcell.math.VolVariable; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.parser.Expression; import cbit.vcell.parser.ExpressionException; import cbit.vcell.solver.AnnotatedFunction; import cbit.vcell.solver.AnnotatedFunction.FunctionCategory; import cbit.vcell.solver.DefaultOutputTimeSpec; import cbit.vcell.solver.OutputTimeSpec; -import cbit.vcell.solver.SimulationSymbolTable; +import cbit.vcell.solver.simulation.SimulationSymbolTable; import cbit.vcell.solver.SolverException; import cbit.vcell.solver.TimeBounds; import cbit.vcell.solver.server.SimulationMessage; @@ -63,7 +62,7 @@ public abstract class SundialsSolver extends SimpleCompiledSolver implements ODE /** * IDASolver constructor comment. */ -public SundialsSolver(SimulationTask simTask, File directory, boolean bMessaging) throws SolverException { +public SundialsSolver(StandardSimulationTask simTask, File directory, boolean bMessaging) throws SolverException { super(simTask, directory, bMessaging); if (simTask.getSimulation().isSpatial()) { throw new SolverException("Cannot use SundialsSolver on spatial simulation"); diff --git a/vcell-core/src/main/java/cbit/vcell/solver/server/Solver.java b/vcell-core/src/main/java/cbit/vcell/solver/server/Solver.java index 157dae7ad3..069b3adc1d 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/server/Solver.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/server/Solver.java @@ -10,7 +10,7 @@ package cbit.vcell.solver.server; -import cbit.vcell.solver.SimulationJob; +import cbit.vcell.solver.simulation.SimulationJob; /** * Any kind of a solver. Its implementors implement specific diff --git a/vcell-core/src/main/java/cbit/vcell/solver/server/SolverFactory.java b/vcell-core/src/main/java/cbit/vcell/solver/server/SolverFactory.java index c7c3791f39..f91bea542a 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/server/SolverFactory.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/server/SolverFactory.java @@ -20,7 +20,7 @@ import org.vcell.solver.smoldyn.SmoldynSolver; import cbit.util.xml.XmlUtil; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.solver.SolverDescription; import cbit.vcell.solver.SolverException; import cbit.vcell.solver.ode.AdamsMoultonFiveSolver; @@ -49,7 +49,7 @@ public class SolverFactory { */ private interface Maker { - Solver make(SimulationTask task, File userDir, File parallelWorkingDirectory, boolean messaging) throws SolverException; + Solver make(StandardSimulationTask task, File userDir, File parallelWorkingDirectory, boolean messaging) throws SolverException; } private static final Map FACTORY = new HashMap( ); @@ -62,7 +62,7 @@ private interface Maker { FACTORY.put(SolverDescription.VCellPetsc, fv); Maker chomboMaker = new Maker(){ @Override - public Solver make(SimulationTask t, File userDir, File parallelWorkingDir, boolean m) throws SolverException { + public Solver make(StandardSimulationTask t, File userDir, File parallelWorkingDir, boolean m) throws SolverException { if (t.getSimulation().getSolverTaskDescription().isParallel()){ File workingDir = parallelWorkingDir; File destinationDirectory = userDir; @@ -96,13 +96,13 @@ public Solver make(SimulationTask t, File userDir, File parallelWorkingDir, bool FACTORY.put(SolverDescription.Comsol, (t,d,pwd,m) -> new ComsolSolver(t, d) ); } -public static Solver createSolver(File userDir, SimulationTask simTask, boolean bMessaging) throws SolverException { +public static Solver createSolver(File userDir, StandardSimulationTask simTask, boolean bMessaging) throws SolverException { { return createSolver(userDir, null, simTask, bMessaging); } } -public static Solver createSolver(File userDir, File parallelDir, SimulationTask simTask, boolean bMessaging) throws SolverException { +public static Solver createSolver(File userDir, File parallelDir, StandardSimulationTask simTask, boolean bMessaging) throws SolverException { SolverDescription solverDescription = simTask.getSimulationJob().getSimulation().getSolverTaskDescription().getSolverDescription(); File simTaskFile = new File(userDir,simTask.getSimulationJobID()+"_"+simTask.getTaskID()+".simtask.xml"); diff --git a/vcell-core/src/main/java/cbit/vcell/solver/server/SolverFileWriter.java b/vcell-core/src/main/java/cbit/vcell/solver/server/SolverFileWriter.java index c86b96ad8d..375c3cfde5 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/server/SolverFileWriter.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/server/SolverFileWriter.java @@ -15,7 +15,7 @@ import cbit.vcell.message.VCellQueue; import cbit.vcell.message.VCellTopic; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.resource.PropertyLoader; /** * Insert the type's description here. @@ -25,7 +25,7 @@ public abstract class SolverFileWriter { protected PrintWriter printWriter = null; protected boolean bUseMessaging = true; - protected final SimulationTask simTask; + protected final StandardSimulationTask simTask; protected enum SolverInputFileKeyword { JMS_PARAM_BEGIN("jms"), @@ -47,7 +47,7 @@ protected enum SolverInputFileKeyword { /** * OdeFileCoder constructor comment. */ -public SolverFileWriter(PrintWriter pw, SimulationTask simTask, boolean messaging) { +public SolverFileWriter(PrintWriter pw, StandardSimulationTask simTask, boolean messaging) { printWriter = pw; this.simTask = simTask; bUseMessaging = messaging; @@ -141,7 +141,7 @@ protected Element xmlJMSParameters () { return jms; } -public SimulationTask getSimulationTask() +public StandardSimulationTask getSimulationTask() { return simTask; } diff --git a/vcell-core/src/main/java/cbit/vcell/solver/Simulation.java b/vcell-core/src/main/java/cbit/vcell/solver/simulation/Simulation.java similarity index 96% rename from vcell-core/src/main/java/cbit/vcell/solver/Simulation.java rename to vcell-core/src/main/java/cbit/vcell/solver/simulation/Simulation.java index 20f74f9bd0..5c54a14e2b 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/Simulation.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/simulation/Simulation.java @@ -1,1093 +1,1096 @@ -/* - * Copyright (C) 1999-2011 University of Connecticut Health Center - * - * Licensed under the MIT License (the "License"). - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.opensource.org/licenses/mit-license.php - */ - -package cbit.vcell.solver; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import java.beans.PropertyVetoException; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.vcell.model.rbm.ComponentStateDefinition; -import org.vcell.model.rbm.MolecularComponent; -import org.vcell.model.rbm.MolecularType; -import org.vcell.model.rbm.SpeciesPattern; -import org.vcell.util.CommentStringTokenizer; -import org.vcell.util.Compare; -import org.vcell.util.DataAccessException; -import org.vcell.util.Displayable; -import org.vcell.util.Issue; -import org.vcell.util.Issue.IssueCategory; -import org.vcell.util.Issue.IssueSource; -import org.vcell.util.IssueContext; -import org.vcell.util.Matchable; -import org.vcell.util.TokenMangler; -import org.vcell.util.document.Identifiable; -import org.vcell.util.document.KeyValue; -import org.vcell.util.document.PropertyConstants; -import org.vcell.util.document.SimulationVersion; -import org.vcell.util.document.Version; -import org.vcell.util.document.Versionable; - -import cbit.vcell.mapping.SimulationContext.Application; -import cbit.vcell.mapping.SimulationContext.Kind; -import cbit.vcell.mapping.ReactionContext; -import cbit.vcell.mapping.ReactionRuleSpec; -import cbit.vcell.mapping.ReactionRuleSpec.Subtype; -import cbit.vcell.mapping.ReactionSpec; -import cbit.vcell.mapping.SimulationContext; -import cbit.vcell.mapping.SimulationContextEntity; -import cbit.vcell.mapping.SpeciesContextSpec; -import cbit.vcell.math.MathCompareResults; -import cbit.vcell.math.MathDescription; -import cbit.vcell.math.MathException; -import cbit.vcell.math.VCML; -import cbit.vcell.model.Model; -import cbit.vcell.model.SpeciesContext; -import cbit.vcell.solver.SolverDescription.SolverFeature; -/** - * Specifies the problem to be solved by a solver. - * It is subclassed for each type of problem/solver. - * Creation date: (8/16/2000 11:08:33 PM) - * @author: John Wagner - */ -@SuppressWarnings("serial") -public class Simulation implements Versionable, Matchable, java.beans.VetoableChangeListener, java.io.Serializable, PropertyChangeListener, - SimulationContextEntity, IssueSource, Identifiable, Displayable { - - public static final String PSF_FUNCTION_NAME = "__PSF__"; - /** - * {@link PropertyChangeEvent#getPropertyName()} value - */ - public static final String PROPERTY_NAME_SOLVER_TASK_DESCRIPTION = "solverTaskDescription"; - /** - * {@link PropertyChangeEvent#getPropertyName()} value - */ - public static final String PROPERTY_NAME_MATH_DESCRIPTION = "mathDescription"; - // size quotas enforced per simulation - public static final int MAX_LIMIT_NON_SPATIAL_TIMEPOINTS = 100000; - public static final int MAX_LIMIT_SPATIAL_TIMEPOINTS = 100000; - public static final int MAX_LIMIT_0DE_MEGABYTES = 200; //gcw 3/18/2015 bump for now so Phd candiate can get her work done - public static final int MAX_LIMIT_PDE_MEGABYTES = 200000; - public static final int MAX_LIMIT_STOCH_MEGABYTES = 200; //stoch - public static final int WARNING_NON_SPATIAL_TIMEPOINTS = 5000; - public static final int WARNING_SPATIAL_TIMEPOINTS = 1000; - public static final int WARNING_0DE_MEGABYTES = 5; - public static final int WARNING_PDE_MEGABYTES = 200; - public static final int WARNING_STOCH_MEGABYTES = 100; //stoch - - public static final int WARNING_SCAN_JOBS = 20; - public static final int MAX_LIMIT_SCAN_JOBS = 100; - /** - * Database version of the Simulation. - */ - private SimulationVersion fieldSimulationVersion = null; - /** - * Mathematical description of the physiological model. - */ - private MathDescription fieldMathDescription = null; - /** - * An ASCII description of the run. - */ - private java.lang.String fieldDescription = new String(); - /** - * The name of the run, also used as a version name. - */ - private java.lang.String fieldName = new String("NoName"); - /** - * Settings that override those specified in the MathDescription. - */ - private transient SimulationOwner simulationOwner = null; - private DataProcessingInstructions dataProcessingInstructions = null; - private MathOverrides fieldMathOverrides = null; - protected transient java.beans.VetoableChangeSupport vetoPropertyChange; - protected transient java.beans.PropertyChangeSupport propertyChange; - private SolverTaskDescription fieldSolverTaskDescription = null; - private java.lang.String fieldSimulationIdentifier = null; - private MeshSpecification fieldMeshSpecification = null; - private boolean fieldIsDirty = false; - private String fieldImportedTaskID; - - public static class Counters { // SpringSaLaD post processing counters, structure to be determined, will be moved appropriately - - public static void writeMoleculeCounters(SimulationContext simContext, StringBuilder sb) { - if(simContext == null) { - sb.append("\n"); - return; - } - if(simContext.getApplicationType() != Application.SPRINGSALAD) { - sb.append("\n"); - return; - } - Model model = simContext.getBioModel().getModel(); - SpeciesContext[] speciesContexts = model.getSpeciesContexts(); - for(SpeciesContext sc : speciesContexts) { - if(SpeciesContextSpec.SourceMoleculeString.equals(sc.getName()) || SpeciesContextSpec.SinkMoleculeString.equals(sc.getName())) { - continue; // skip the Source and the Sink molecules (use in Creation / Destruction reactions) - } - SpeciesPattern sp = sc.getSpeciesPattern(); - if(sp == null || sp.getMolecularTypePatterns() == null || sp.getMolecularTypePatterns().isEmpty()) { - continue; - } - // Each MolecularType can be used for only one SpeciesContext - MolecularType mt = sp.getMolecularTypePatterns().get(0).getMolecularType(); - sb.append("'").append(mt.getName()).append("' : ") - .append("Measure Total Free Bound"); - sb.append("\n"); - } - } - - public static void writeStateCounters(SimulationContext simContext, StringBuilder sb) { - if(simContext == null) { - sb.append("\n"); - return; - } - if(simContext.getApplicationType() != Application.SPRINGSALAD) { - sb.append("\n"); - return; - } - Model model = simContext.getBioModel().getModel(); - SpeciesContext[] speciesContexts = model.getSpeciesContexts(); - for(SpeciesContext sc : speciesContexts) { - SpeciesPattern sp = sc.getSpeciesPattern(); - if(sp == null || sp.getMolecularTypePatterns() == null || sp.getMolecularTypePatterns().isEmpty()) { - continue; - } - MolecularType mt = sp.getMolecularTypePatterns().get(0).getMolecularType(); - List mcList = mt.getComponentList(); - for(MolecularComponent mc : mcList) { - List csdList = mc.getComponentStateDefinitions(); - for(ComponentStateDefinition csd : csdList) { - sb.append("'").append(mt.getName()).append("' : ") - .append("'").append(mc.getName()).append("' : ") - .append("'").append(csd.getName()).append("' : ") - .append("Measure Total Free Bound"); - sb.append("\n"); - } - } - } - } - - public static void writeBondCounters(SimulationContext simContext, StringBuilder sb) { - if(simContext == null) { - sb.append("\n"); - return; - } - if(simContext.getApplicationType() != Application.SPRINGSALAD) { - sb.append("\n"); - return; - } - ReactionContext reactionContext = simContext.getReactionContext(); - ReactionRuleSpec[] reactionRuleSpecs = reactionContext.getReactionRuleSpecs(); - for(ReactionRuleSpec rrs : reactionRuleSpecs) { - if(rrs.isExcluded()) { - continue; - } - Map analysisResults = new LinkedHashMap<> (); - rrs.analizeReaction(analysisResults); - Subtype subtype = rrs.getSubtype(analysisResults); - if(subtype == ReactionRuleSpec.Subtype.BINDING) { - sb.append("'").append(rrs.getReactionRule().getName()).append("' : ") // was ("' : '") - .append("Counted"); - sb.append("\n"); - } - } - } - - public static void writeSitePropertyCounters(SimulationContext simContext, StringBuilder sb) { - if(simContext == null) { - sb.append("\n"); - return; - } - if(simContext.getApplicationType() != Application.SPRINGSALAD) { - sb.append("\n"); - return; - } - Model model = simContext.getBioModel().getModel(); - SpeciesContext[] speciesContexts = model.getSpeciesContexts(); - for(SpeciesContext sc : speciesContexts) { - SpeciesPattern sp = sc.getSpeciesPattern(); - if(sp == null || sp.getMolecularTypePatterns() == null || sp.getMolecularTypePatterns().isEmpty()) { - continue; - } - MolecularType mt = sp.getMolecularTypePatterns().get(0).getMolecularType(); - List mcList = mt.getComponentList(); - for(MolecularComponent mc : mcList) { - sb.append("'").append(mt.getName()).append("' ") - .append("Site " + (mc.getIndex()-1)).append(" : ") - .append("Track Properties true"); - sb.append("\n"); - } - } - } - } - -private Simulation( ) { -} -/** - * One of three ways to construct a Simulation. This constructor - * is used when creating a new Simulation. - */ -public Simulation(SimulationVersion argSimulationVersion, MathDescription mathDescription, SimulationOwner simulationOwner) { - this( ); - addVetoableChangeListener(this); - this.fieldSimulationVersion = argSimulationVersion; - if (fieldSimulationVersion != null) { - if (fieldSimulationVersion.getParentSimulationReference()!=null){ - this.fieldSimulationIdentifier = null; - }else{ - this.fieldSimulationIdentifier = createSimulationID(fieldSimulationVersion.getVersionKey()); - } - } - - this.fieldName = argSimulationVersion.getName(); - this.fieldDescription = argSimulationVersion.getAnnot(); - this.simulationOwner = simulationOwner; - - try { - setMathDescription(mathDescription); - } catch (java.beans.PropertyVetoException e) { - throw new RuntimeException(e.getMessage(), e); - } - // Must set the MathDescription before constructing these... - if (mathDescription.getGeometry().getDimension()>0){ - fieldMeshSpecification = new MeshSpecification(mathDescription.getGeometry()); - } - fieldMathOverrides = new MathOverrides(this); - fieldSolverTaskDescription = new SolverTaskDescription(this); - refreshDependencies(); -} - - -/** - * One of three ways to construct a Simulation. This constructor - * is used when creating a Simulation from the database. - */ -public Simulation(SimulationVersion simulationVersion, MathDescription mathDescription, CommentStringTokenizer mathOverridesTokenizer, CommentStringTokenizer solverTaskDescriptionTokenizer) throws DataAccessException, PropertyVetoException { - this( ); - addVetoableChangeListener(this); - - fieldSimulationVersion = simulationVersion; - if (simulationVersion!=null){ - fieldName = simulationVersion.getName(); - fieldDescription = simulationVersion.getAnnot(); - if (simulationVersion.getParentSimulationReference()!=null){ - fieldSimulationIdentifier = null; - }else{ - fieldSimulationIdentifier = createSimulationID(simulationVersion.getVersionKey()); - } - } - if (mathDescription != null){ - setMathDescription(mathDescription); - if (mathDescription.getGeometry().getDimension()>0){ - fieldMeshSpecification = new MeshSpecification(mathDescription.getGeometry()); - } - } - // Must set the MathDescription before constructing these... - fieldMathOverrides = new MathOverrides(this, mathOverridesTokenizer); - fieldSolverTaskDescription = new SolverTaskDescription(this, solverTaskDescriptionTokenizer); - refreshDependencies(); -} - - -/** - * One of three ways to construct a Simulation. This constructor - * is used when creating a new Simulation. - */ -public Simulation(MathDescription mathDescription, SimulationOwner simulationOwner) { - this( ); - addVetoableChangeListener(this); - - try { - setMathDescription(mathDescription); - } catch (java.beans.PropertyVetoException e) { - throw new RuntimeException(e.getMessage(), e); - } - fieldName = mathDescription.getName()+"_"+Math.random(); - this.simulationOwner = simulationOwner; - // Must set the MathDescription before constructing these... - if (mathDescription.getGeometry().getDimension()>0){ - fieldMeshSpecification = new MeshSpecification(mathDescription.getGeometry()); - } - fieldMathOverrides = new MathOverrides(this); - fieldSolverTaskDescription = new SolverTaskDescription(this); - -} - - -/** - * One of three ways to construct a Simulation. This constructor - * is used when copying a Simulation from an existing one. - */ -public Simulation(Simulation simulation) { - this(simulation,false); -} - - -/** - * One of three ways to construct a Simulation. This constructor - * is used when copying a Simulation from an existing one. - */ -public Simulation(Simulation simulation, boolean bCloneMath) { - this( ); - addVetoableChangeListener(this); - - fieldImportedTaskID = simulation.getImportedTaskID(); - fieldSimulationVersion = null; - fieldName = simulation.getName(); - fieldDescription = simulation.getDescription(); - fieldSimulationIdentifier = null; - if (bCloneMath){ - fieldMathDescription = new MathDescription(simulation.getMathDescription()); - }else{ - fieldMathDescription = simulation.getMathDescription(); - } - if (simulation.getMeshSpecification()!=null){ - fieldMeshSpecification = new MeshSpecification(simulation.getMeshSpecification()); - }else{ - fieldMeshSpecification = null; - } - simulationOwner = simulation.getSimulationOwner(); - // Must set the MathDescription before constructing these... - fieldMathOverrides = new MathOverrides (this, simulation.getMathOverrides()); - fieldSolverTaskDescription = new SolverTaskDescription(this, simulation.getSolverTaskDescription()); - dataProcessingInstructions = simulation.dataProcessingInstructions; - fieldImportedTaskID = simulation.fieldImportedTaskID; - - refreshDependencies(); -} - - -public SimulationOwner getSimulationOwner() { - return simulationOwner; -} - - -public void setSimulationOwner(SimulationOwner simulationOwner) { - this.simulationOwner = simulationOwner; -} - - -/** - * The addPropertyChangeListener method was generated to support the propertyChange field. - */ -public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener listener) { - getPropertyChange().addPropertyChangeListener(listener); -} - -/** - * The addVetoableChangeListener method was generated to support the vetoPropertyChange field. - */ -public synchronized void addVetoableChangeListener(java.beans.VetoableChangeListener listener) { - getVetoPropertyChange().addVetoableChangeListener(listener); -} - -/** - * Insert the method's description here. - * Creation date: (4/24/2003 3:33:12 PM) - */ -public void clearVersion() { - fieldSimulationVersion = null; -} - - -/** - * compareEqual method comment. - */ -public boolean compareEqual(Matchable object) { - if (this == object) { - return (true); - } - if (object != null && object instanceof Simulation) { - Simulation simulation = (Simulation) object; - // - // check for content - // - if (!compareEqualMathematically(simulation)){ - return false; - } - // - // check for true equality - // - if (!Compare.isEqual(getName(),simulation.getName())){ - return false; - } - if (!Compare.isEqualOrNull(getDescription(),simulation.getDescription())){ - return false; - } - return true; - } - return false; - -} - - -/** - * compareEqual method comment. - */ -private boolean compareEqualMathematically(Simulation simulation) { - if (this == simulation) { - return true; - } - if (!getMathDescription().compareEqual(simulation.getMathDescription())) return (false); - if (!getMathOverrides().compareEqual(simulation.getMathOverrides())) return (false); - if (!getSolverTaskDescription().compareEqual(simulation.getSolverTaskDescription())) return (false); - if (!Compare.isEqualOrNull(getMeshSpecification(),simulation.getMeshSpecification())) return (false); - if (!Compare.isEqualOrNull(dataProcessingInstructions, simulation.dataProcessingInstructions)) return (false); - - return true; -} - -public static String createSimulationID(KeyValue simKey) { - return "SimID_"+simKey; -} - - -/** - * The firePropertyChange method was generated to support the propertyChange field. - */ -public void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue) { - getPropertyChange().firePropertyChange(propertyName, oldValue, newValue); -} - - -/** - * The fireVetoableChange method was generated to support the vetoPropertyChange field. - */ -public void fireVetoableChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue) throws java.beans.PropertyVetoException { - getVetoPropertyChange().fireVetoableChange(propertyName, oldValue, newValue); -} - - -public void forceNewVersionAnnotation(SimulationVersion newSimulationVersion) throws PropertyVetoException { - if (getVersion().getVersionKey().equals(newSimulationVersion.getVersionKey())) { - setVersion(newSimulationVersion); - } else { - throw new RuntimeException("Simulation.forceNewVersionAnnotation failed : version keys not equal"); - } -} - - -public java.lang.String getDescription() { - return fieldDescription; -} - - -public boolean getIsDirty() { - return fieldIsDirty; -} - -/** - * Gets the isSpatial property (boolean) value. - * @return {@link #fieldMathDescription#isSpatial()} - */ -public boolean isSpatial() { - assert fieldMathDescription != null ; - return fieldMathDescription.isSpatial(); -} - - -//public void gatherIssues(IssueContext issueContext, List issueList) { -// -// getMathOverrides().gatherIssues(issueContext, issueList); -// -// // -// // Check if the math corresponding to this simulation has fast systems and if the solverTaskDescription contains a non-null sensitivity parameter. -// // If so, the simulation is invalid. -// // -// if (fieldMathDescription != null && getSolverTaskDescription() != null) { -// if (getMathDescription().hasFastSystems() && (getSolverTaskDescription().getSensitivityParameter() != null)) { -// Issue issue = new Issue(this, issueContext, IssueCategory.Simulation_SensAnal_And_FastSystem, -// VCellErrorMessages.getErrorMessage(VCellErrorMessages.SIMULATION_SENSANAL_FASTSYSTEM,getName()), -// Issue.SEVERITY_ERROR); -// issueList.add(issue); -// } -// } -// if (fieldMathDescription==null || !fieldMathDescription.isValid()){ -// Issue issue = new Issue(this, issueContext, IssueCategory.MathDescription_MathException,fieldMathDescription.getWarning(),Issue.SEVERITY_ERROR); -// issueList.add(issue); -// } -// -// Set supportedFeatures = getSolverTaskDescription().getSolverDescription().getSupportedFeatures(); -// Set missingFeatures = getRequiredFeatures(); -// missingFeatures.removeAll(supportedFeatures); -// -// String text = "The selected Solver does not support the following required features: \n"; -// for (SolverFeature sf : missingFeatures) { -// text += sf.getName() + "\n"; -// } -// -// if (!missingFeatures.isEmpty()) { -// System.out.println(this.getKey()); -// String tooltip = "The selected Solver " + getSolverTaskDescription().getSolverDescription().getDisplayLabel() + -// " does not support the following required features:
"; -// for (SolverFeature sf : missingFeatures) { -// tooltip += "   " + sf.getName() + "
"; -// } -// CollectiongoodSolvers = SolverDescription.getSolverDescriptions(getRequiredFeatures()); -// assert goodSolvers != null; -// if (!goodSolvers.isEmpty()) { -// tooltip += "Please choose one of the solvers :
"; -// for (SolverDescription sd : goodSolvers) { -// tooltip += "   " + sd.getDisplayLabel() + "
"; -// } -// } -// Issue issue = new Issue(this,issueContext, IssueCategory.MathDescription_MathException, text, tooltip, Issue.SEVERITY_ERROR); -// issueList.add(issue); -// } -//} - -// this doesn't seem to be called anywhere, we deprecate it (also, it doesn't know about Feature_Springs) -// jul 2023 danv -@Deprecated -public Set getRequiredFeatures() { - Set requiredFeatures = new HashSet(); - final MathDescription md = getMathDescription(); - if (isSpatial()) { - requiredFeatures.add(SolverFeature.Feature_Spatial); - } else { - requiredFeatures.add(SolverFeature.Feature_NonSpatial); - } - - final boolean hybrid = md.isSpatialHybrid(); - final boolean stoch = md.isNonSpatialStoch() || md.isSpatialStoch(); - final boolean ruleBased = md.isRuleBased(); - if (hybrid) { - requiredFeatures.add(SolverFeature.Feature_Hybrid); - } - if (stoch && !hybrid) { - requiredFeatures.add(SolverFeature.Feature_Stochastic); - } - if (!stoch && !ruleBased) { - requiredFeatures.add(SolverFeature.Feature_Deterministic); - } - if (md.hasFastSystems()) { - requiredFeatures.add(SolverFeature.Feature_FastSystem); - } - if (md.hasPeriodicBoundaryCondition()) { - requiredFeatures.add(SolverFeature.Feature_PeriodicBoundaryCondition); - } - if (md.hasEvents()) { - requiredFeatures.add(SolverFeature.Feature_Events); - } - if (md.hasRandomVariables()) { - requiredFeatures.add(SolverFeature.Feature_RandomVariables); - } - if (getSolverTaskDescription().getStopAtSpatiallyUniformErrorTolerance() != null) { - requiredFeatures.add(SolverFeature.Feature_StopAtSpatiallyUniform); - } - if (getDataProcessingInstructions() != null) { - requiredFeatures.add(SolverFeature.Feature_DataProcessingInstructions); - } - if (md.getVariable(PSF_FUNCTION_NAME) != null) { - requiredFeatures.add(SolverFeature.Feature_PSF); - } - if (isSerialParameterScan()) { - requiredFeatures.add(SolverFeature.Feature_SerialParameterScans); - } - if (md.hasVolumeRegionEquations()) { - requiredFeatures.add(SolverFeature.Feature_VolumeRegionEquations); - } - if (md.hasRegionSizeFunctions()) { - requiredFeatures.add(SolverFeature.Feature_RegionSizeFunctions); - } - if (md.hasGradient()) { - requiredFeatures.add(SolverFeature.Feature_GradientSourceTerm); - } - if (md.getPostProcessingBlock().getNumDataGenerators() > 0) { - requiredFeatures.add(SolverFeature.Feature_PostProcessingBlock); - } - if (md.isRuleBased()){ - requiredFeatures.add(SolverFeature.Feature_Rulebased); - } - return requiredFeatures; -} -/** - * Insert the method's description here. - * Creation date: (10/24/00 1:36:01 PM) - * @return cbit.sql.KeyValue - */ -public KeyValue getKey() { - return (getVersion()!=null)?(getVersion().getVersionKey()):(null); -} - - -/** - * Gets the mathDescription property (cbit.vcell.math.MathDescription) value. - * @return The mathDescription property value. - */ -public MathDescription getMathDescription() { - return fieldMathDescription; -} - - -/** - * Gets the mathOverrides property (cbit.vcell.solver.MathOverrides) value. - * @return The mathOverrides property value. - */ -public MathOverrides getMathOverrides() { - return fieldMathOverrides; -} - - -/** - * Gets the meshSpecification property (cbit.vcell.mesh.MeshSpecification) value. - * @return The meshSpecification property value. - * @see #setMeshSpecification - */ -public MeshSpecification getMeshSpecification() { - return fieldMeshSpecification; -} - - -/** - * Gets the name property (java.lang.String) value. - * @return The name property value. - * @see #setName - */ -public java.lang.String getName() { - return fieldName; -} - - -/** - * Accessor for the propertyChange field. - */ -protected java.beans.PropertyChangeSupport getPropertyChange() { - if (propertyChange == null) { - propertyChange = new java.beans.PropertyChangeSupport(this); - }; - return propertyChange; -} - - -/** - * Insert the method's description here. - * Creation date: (10/5/2005 1:02:08 PM) - * @return int - */ -public int getScanCount() { - return getMathOverrides().getScanCount(); -} - - -/** - * Gets the simulationIdentifier property (java.lang.String) value. - * @return The simulationIdentifier property value. - */ -public java.lang.String getSimulationID() { - return fieldSimulationIdentifier; -} - - -/** - * Insert the method's description here. - * Creation date: (10/30/00 11:48:21 AM) - * @return cbit.vcell.solver.SimulationInfo - */ -public SimulationInfo getSimulationInfo() { - if (getVersion() != null) { - return new SimulationInfo( - getMathDescription().getKey(), - getSimulationVersion(),null); - } else { - return null; - } -} - - -/** - * Insert the method's description here. - * Creation date: (10/24/00 1:34:10 PM) - * @return cbit.sql.Version - */ -public SimulationVersion getSimulationVersion() { - return fieldSimulationVersion; -} - - -/** - * Gets the solverTaskDescription property (cbit.vcell.solver.SolverTaskDescription) value. - * @return The solverTaskDescription property value. - * @see #setSolverTaskDescription - */ -public SolverTaskDescription getSolverTaskDescription() { - return fieldSolverTaskDescription; -} - - -/** - * Insert the method's description here. - * Creation date: (10/30/00 11:56:03 AM) - * @return java.lang.String - */ -public String getVCML() throws MathException { - - StringBuffer buffer = new StringBuffer(); - - String name = (getVersion()!=null)?(getVersion().getName()):"unnamedSimulation"; - buffer.append(VCML.Simulation+" "+name+" {\n"); - - // - // write MathDescription - // - buffer.append(VCML.MathDescription+" "+getMathDescription().getVCML_database()+"\n"); - - // - // write SolverTaskDescription - // - buffer.append(getSolverTaskDescription().getVCML()+"\n"); - - // - // write SolverTaskDescription - // - buffer.append(getMathOverrides().getVCML()+"\n"); - - // - // write MeshSpecification - // - if (getMeshSpecification()!=null){ - buffer.append(getMeshSpecification().getVCML()+"\n"); - } - - buffer.append("}\n"); - return buffer.toString(); -} - - -/** - * Insert the method's description here. - * Creation date: (10/24/00 1:34:10 PM) - * @return cbit.sql.Version - */ -public Version getVersion() { - return fieldSimulationVersion; -} - - -/** - * Accessor for the vetoPropertyChange field. - */ -protected java.beans.VetoableChangeSupport getVetoPropertyChange() { - if (vetoPropertyChange == null) { - vetoPropertyChange = new java.beans.VetoableChangeSupport(this); - }; - return vetoPropertyChange; -} - - -/** - * The hasListeners method was generated to support the propertyChange field. - */ -public synchronized boolean hasListeners(java.lang.String propertyName) { - return getPropertyChange().hasListeners(propertyName); -} - -/** - * Insert the method's description here. - * Creation date: (5/11/01 4:00:35 PM) - */ -public void refreshDependencies() { - removeVetoableChangeListener(this); - addVetoableChangeListener(this); - if (getMeshSpecification()!=null){ - getMeshSpecification().refreshDependencies(); - } - getSolverTaskDescription().refreshDependencies(); - getMathOverrides().refreshDependencies(); - - getMathDescription().removePropertyChangeListener(this); - getMathDescription().addPropertyChangeListener(this); - -} - -/** - * The removePropertyChangeListener method was generated to support the propertyChange field. - */ -public synchronized void removePropertyChangeListener(java.beans.PropertyChangeListener listener) { - getPropertyChange().removePropertyChangeListener(listener); -} - -/** - * The removeVetoableChangeListener method was generated to support the vetoPropertyChange field. - */ -public synchronized void removeVetoableChangeListener(java.beans.VetoableChangeListener listener) { - getVetoPropertyChange().removeVetoableChangeListener(listener); -} - -/** - * Sets the description property (java.lang.String) value. - * @param description The new value for the property. - * @see #getDescription - */ -public void setDescription(java.lang.String description) throws java.beans.PropertyVetoException { - java.lang.String oldValue = fieldDescription; - fireVetoableChange("description", oldValue, description); - fieldDescription = description; - firePropertyChange("description", oldValue, description); -} - - -/** - * Sets the isDirty property (boolean) value. - * @param isDirty The new value for the property. - * @see #getIsDirty - */ -public void setIsDirty(boolean isDirty) { - boolean oldValue = fieldIsDirty; - fieldIsDirty = isDirty; - firePropertyChange("isDirty", oldValue, isDirty); -} - - -public void setMathDescription(MathDescription mathDescription) throws java.beans.PropertyVetoException { - MathDescription oldValue = fieldMathDescription; - fireVetoableChange("mathDescription", oldValue, mathDescription); - fieldMathDescription = mathDescription; - - if(oldValue != null){ - oldValue.removePropertyChangeListener(this); - } - if(fieldMathDescription != null){ - fieldMathDescription.removePropertyChangeListener(this); - fieldMathDescription.addPropertyChangeListener(this); - } - refreshMeshSpec(); - - // - // refresh MathOverrides - // - if (mathDescription!=null && getMathOverrides()!=null && oldValue != fieldMathDescription){ - getMathOverrides().updateFromMathDescription(true); - } - - // - // refresh SolverTaskDescription (reset if oldMath is spatial and newMath is non-spatial .... or opposite). - // - if (oldValue==null || mathDescription==null || oldValue.isSpatial()!=mathDescription.isSpatial()){ - fieldSolverTaskDescription = new SolverTaskDescription(this); - } - - firePropertyChange("mathDescription", oldValue, mathDescription); -} - - -public void setMathOverrides(MathOverrides mathOverrides) { - MathOverrides oldValue = fieldMathOverrides; - fieldMathOverrides = mathOverrides; - // update overrides - mathOverrides.setSimulation(this); - mathOverrides.updateFromMathDescription(false); - firePropertyChange("mathOverrides", oldValue, mathOverrides); -} - - -/** - * Sets the meshSpecification property (cbit.vcell.mesh.MeshSpecification) value. - * @param meshSpecification The new value for the property. - * @exception java.beans.PropertyVetoException The exception description. - * @see #getMeshSpecification - */ -public void setMeshSpecification(MeshSpecification meshSpecification) throws java.beans.PropertyVetoException { - MeshSpecification oldValue = fieldMeshSpecification; - fireVetoableChange("meshSpecification", oldValue, meshSpecification); - fieldMeshSpecification = meshSpecification; - firePropertyChange("meshSpecification", oldValue, meshSpecification); -} - - -/** - * Sets the name property (java.lang.String) value. - * @param name The new value for the property. - * @see #setName - */ -public void setName(java.lang.String name) throws java.beans.PropertyVetoException { - java.lang.String oldValue = fieldName; - fireVetoableChange(PropertyConstants.PROPERTY_NAME_NAME, oldValue, name); - fieldName = name; - firePropertyChange(PropertyConstants.PROPERTY_NAME_NAME, oldValue, name); -} - - -/** - * Sets the solverTaskDescription property (cbit.vcell.solver.SolverTaskDescription) value. - * @param solverTaskDescription The new value for the property. - * @exception java.beans.PropertyVetoException The exception description. - * @see #getSolverTaskDescription() - */ -public void setSolverTaskDescription(SolverTaskDescription solverTaskDescription) throws java.beans.PropertyVetoException { - SolverTaskDescription oldValue = fieldSolverTaskDescription; - fireVetoableChange(PROPERTY_NAME_SOLVER_TASK_DESCRIPTION, oldValue, solverTaskDescription); - fieldSolverTaskDescription = solverTaskDescription; - if (solverTaskDescription != null && solverTaskDescription.getSimulation() != this) { - throw new IllegalArgumentException("SolverTaskDescription simulation field points to wrong simulation"); - } - firePropertyChange(PROPERTY_NAME_SOLVER_TASK_DESCRIPTION, oldValue, solverTaskDescription); -} - - -private void setVersion(SimulationVersion simulationVersion) throws PropertyVetoException { - this.fieldSimulationVersion = simulationVersion; - if (simulationVersion != null){ - setName(simulationVersion.getName()); - setDescription(simulationVersion.getAnnot()); - } -} - -public static boolean testEquivalency(Simulation memorySimulation, Simulation databaseSimulation, MathCompareResults mathCompareResults) { - - if (memorySimulation == databaseSimulation){ - return true; - } - - if (!mathCompareResults.isEquivalent()){ - return false; - }else{ - if (!memorySimulation.getSolverTaskDescription().compareEqual(databaseSimulation.getSolverTaskDescription())){ - return false; - } - if (!Compare.isEqualOrNull(memorySimulation.getMeshSpecification(),databaseSimulation.getMeshSpecification())){ - return false; - } - // - // math overrides are only influence the solution if they actually override something. - // - // if maths are equal/equivalent and overridden parameters (where actual value != default value) are same - // then the MathDescriptions equality/equivalence is upheld. - // otherwise, they are always different - // - // if (!memorySimulation.getMathOverrides().compareEqualIgnoreDefaults(databaseSimulation.getMathOverrides())){ - // now only non-defaults are stored in overrides... - if (!memorySimulation.getMathOverrides().compareEquivalent(databaseSimulation.getMathOverrides())){ - return false; - } - return true; - } -} - - -public String toString() { - String mathStr = (getMathDescription()!=null)?("Math@"+Integer.toHexString(getMathDescription().hashCode())+"("+getMathDescription().getName()+","+getMathDescription().getKey()+")"):"null"; - return "Simulation@"+Integer.toHexString(hashCode())+"("+getName()+"), "+mathStr; -} - - - /** - * This method gets called when a constrained property is changed. - * - * @param evt a PropertyChangeEvent object describing the - * event source and the property that has changed. - * @exception PropertyVetoException if the recipient wishes the property - * change to be rolled back. - */ -public void vetoableChange(java.beans.PropertyChangeEvent evt) throws java.beans.PropertyVetoException { - TokenMangler.checkNameProperty(this, "simulation", evt); -} - - - public DataProcessingInstructions getDataProcessingInstructions() { - return dataProcessingInstructions; - } - - - public void setDataProcessingInstructions(DataProcessingInstructions dataProcessingInstructions) { - DataProcessingInstructions oldValue = this.dataProcessingInstructions; - this.dataProcessingInstructions = dataProcessingInstructions; - firePropertyChange("dataProcessingInstructions", oldValue, dataProcessingInstructions); -} - - public boolean isSerialParameterScan() { - if (getSolverTaskDescription().isSerialParameterScan() && getScanCount() > 1) { - return true; - } - return false; - } - public boolean isTimeoutDisabled() { - if (getSolverTaskDescription().isTimeoutDisabled()) { - return true; - } - return false; - } - public boolean isBorderExtrapolationDisabled() { - if (getSolverTaskDescription().isBorderExtrapolationDisabled()) { - return true; - } - return false; - } - - public void propertyChange(PropertyChangeEvent evt) { - MathDescription md = getMathDescription(); - boolean bIsMath = evt.getSource() == md; - if(bIsMath && evt.getPropertyName().equals("geometry")){ - try{ - refreshMeshSpec(); - }catch(PropertyVetoException e){ - throw new RuntimeException(e.getMessage(),e); - } - } - } - - private void refreshMeshSpec() throws PropertyVetoException{ - // - // refresh MeshSpecification - // - if (getMathDescription().getGeometry().getDimension()>0){ - if (getMeshSpecification()!=null){ - getMeshSpecification().setGeometry(getMathDescription().getGeometry()); - }else{ - setMeshSpecification(new MeshSpecification(getMathDescription().getGeometry())); - } - }else{ - setMeshSpecification(null); - } - } - - public boolean hasCellCenteredMesh() - { - return getSolverTaskDescription() != null && getSolverTaskDescription().getSolverDescription() != null - && getSolverTaskDescription().getSolverDescription().hasCellCenteredMesh(); - } - - public void gatherIssues(IssueContext issueContext, List issueList) { - - MathOverrides mo = getMathOverrides(); - if(mo!=null && mo.hasUnusedOverrides()) { - String msg = "The Simulation '" + getName() + "' has unused Math Overrides."; - String tip = "Remove the unused Math Overrides."; - issueList.add(new Issue(this, issueContext, IssueCategory.Simulation_Override_NotFound, msg, tip, Issue.Severity.ERROR)); - } - - SimulationWarning.gatherIssues(this, issueContext, issueList); - } - - @Override - public Kind getSimulationContextKind() { - return SimulationContext.Kind.SIMULATIONS_KIND; - } - public void setImportedTaskID(String id) { - fieldImportedTaskID = id; - } - public String getImportedTaskID() { - return fieldImportedTaskID; - } - - public static final String typeName = "Simulation"; - @Override - public String getDisplayName() { - return getName(); - } - @Override - public String getDisplayType() { - return typeName; - } -} +/* + * Copyright (C) 1999-2011 University of Connecticut Health Center + * + * Licensed under the MIT License (the "License"). + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.opensource.org/licenses/mit-license.php + */ + +package cbit.vcell.solver.simulation; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.beans.PropertyVetoException; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import cbit.vcell.solver.DataProcessingInstructions; +import cbit.vcell.solver.MathOverrides; +import cbit.vcell.solver.MeshSpecification; +import cbit.vcell.solver.SolverTaskDescription; +import org.vcell.model.rbm.ComponentStateDefinition; +import org.vcell.model.rbm.MolecularComponent; +import org.vcell.model.rbm.MolecularType; +import org.vcell.model.rbm.SpeciesPattern; +import org.vcell.util.CommentStringTokenizer; +import org.vcell.util.Compare; +import org.vcell.util.DataAccessException; +import org.vcell.util.Displayable; +import org.vcell.util.Issue; +import org.vcell.util.Issue.IssueCategory; +import org.vcell.util.Issue.IssueSource; +import org.vcell.util.IssueContext; +import org.vcell.util.Matchable; +import org.vcell.util.TokenMangler; +import org.vcell.util.document.Identifiable; +import org.vcell.util.document.KeyValue; +import org.vcell.util.document.PropertyConstants; +import org.vcell.util.document.SimulationVersion; +import org.vcell.util.document.Version; +import org.vcell.util.document.Versionable; + +import cbit.vcell.mapping.SimulationContext.Application; +import cbit.vcell.mapping.SimulationContext.Kind; +import cbit.vcell.mapping.ReactionContext; +import cbit.vcell.mapping.ReactionRuleSpec; +import cbit.vcell.mapping.ReactionRuleSpec.Subtype; +import cbit.vcell.mapping.SimulationContext; +import cbit.vcell.mapping.SimulationContextEntity; +import cbit.vcell.mapping.SpeciesContextSpec; +import cbit.vcell.math.MathCompareResults; +import cbit.vcell.math.MathDescription; +import cbit.vcell.math.MathException; +import cbit.vcell.math.VCML; +import cbit.vcell.model.Model; +import cbit.vcell.model.SpeciesContext; +import cbit.vcell.solver.SolverDescription.SolverFeature; +/** + * Specifies the problem to be solved by a solver. + * It is subclassed for each type of problem/solver. + * Creation date: (8/16/2000 11:08:33 PM) + * @author: John Wagner + */ +@SuppressWarnings("serial") +public class Simulation implements Versionable, Matchable, java.beans.VetoableChangeListener, java.io.Serializable, PropertyChangeListener, + SimulationContextEntity, IssueSource, Identifiable, Displayable { + + public static final String PSF_FUNCTION_NAME = "__PSF__"; + /** + * {@link PropertyChangeEvent#getPropertyName()} value + */ + public static final String PROPERTY_NAME_SOLVER_TASK_DESCRIPTION = "solverTaskDescription"; + /** + * {@link PropertyChangeEvent#getPropertyName()} value + */ + public static final String PROPERTY_NAME_MATH_DESCRIPTION = "mathDescription"; + // size quotas enforced per simulation + public static final int MAX_LIMIT_NON_SPATIAL_TIMEPOINTS = 100000; + public static final int MAX_LIMIT_SPATIAL_TIMEPOINTS = 100000; + public static final int MAX_LIMIT_0DE_MEGABYTES = 200; //gcw 3/18/2015 bump for now so Phd candiate can get her work done + public static final int MAX_LIMIT_PDE_MEGABYTES = 200000; + public static final int MAX_LIMIT_STOCH_MEGABYTES = 200; //stoch + public static final int WARNING_NON_SPATIAL_TIMEPOINTS = 5000; + public static final int WARNING_SPATIAL_TIMEPOINTS = 1000; + public static final int WARNING_0DE_MEGABYTES = 5; + public static final int WARNING_PDE_MEGABYTES = 200; + public static final int WARNING_STOCH_MEGABYTES = 100; //stoch + + public static final int WARNING_SCAN_JOBS = 20; + public static final int MAX_LIMIT_SCAN_JOBS = 100; + /** + * Database version of the Simulation. + */ + private SimulationVersion fieldSimulationVersion = null; + /** + * Mathematical description of the physiological model. + */ + private MathDescription fieldMathDescription = null; + /** + * An ASCII description of the run. + */ + private java.lang.String fieldDescription = new String(); + /** + * The name of the run, also used as a version name. + */ + private java.lang.String fieldName = new String("NoName"); + /** + * Settings that override those specified in the MathDescription. + */ + private transient SimulationOwner simulationOwner = null; + private DataProcessingInstructions dataProcessingInstructions = null; + private MathOverrides fieldMathOverrides = null; + protected transient java.beans.VetoableChangeSupport vetoPropertyChange; + protected transient java.beans.PropertyChangeSupport propertyChange; + private SolverTaskDescription fieldSolverTaskDescription = null; + private java.lang.String fieldSimulationIdentifier = null; + private MeshSpecification fieldMeshSpecification = null; + private boolean fieldIsDirty = false; + private String fieldImportedTaskID; + + public static class Counters { // SpringSaLaD post processing counters, structure to be determined, will be moved appropriately + + public static void writeMoleculeCounters(SimulationContext simContext, StringBuilder sb) { + if(simContext == null) { + sb.append("\n"); + return; + } + if(simContext.getApplicationType() != Application.SPRINGSALAD) { + sb.append("\n"); + return; + } + Model model = simContext.getBioModel().getModel(); + SpeciesContext[] speciesContexts = model.getSpeciesContexts(); + for(SpeciesContext sc : speciesContexts) { + if(SpeciesContextSpec.SourceMoleculeString.equals(sc.getName()) || SpeciesContextSpec.SinkMoleculeString.equals(sc.getName())) { + continue; // skip the Source and the Sink molecules (use in Creation / Destruction reactions) + } + SpeciesPattern sp = sc.getSpeciesPattern(); + if(sp == null || sp.getMolecularTypePatterns() == null || sp.getMolecularTypePatterns().isEmpty()) { + continue; + } + // Each MolecularType can be used for only one SpeciesContext + MolecularType mt = sp.getMolecularTypePatterns().get(0).getMolecularType(); + sb.append("'").append(mt.getName()).append("' : ") + .append("Measure Total Free Bound"); + sb.append("\n"); + } + } + + public static void writeStateCounters(SimulationContext simContext, StringBuilder sb) { + if(simContext == null) { + sb.append("\n"); + return; + } + if(simContext.getApplicationType() != Application.SPRINGSALAD) { + sb.append("\n"); + return; + } + Model model = simContext.getBioModel().getModel(); + SpeciesContext[] speciesContexts = model.getSpeciesContexts(); + for(SpeciesContext sc : speciesContexts) { + SpeciesPattern sp = sc.getSpeciesPattern(); + if(sp == null || sp.getMolecularTypePatterns() == null || sp.getMolecularTypePatterns().isEmpty()) { + continue; + } + MolecularType mt = sp.getMolecularTypePatterns().get(0).getMolecularType(); + List mcList = mt.getComponentList(); + for(MolecularComponent mc : mcList) { + List csdList = mc.getComponentStateDefinitions(); + for(ComponentStateDefinition csd : csdList) { + sb.append("'").append(mt.getName()).append("' : ") + .append("'").append(mc.getName()).append("' : ") + .append("'").append(csd.getName()).append("' : ") + .append("Measure Total Free Bound"); + sb.append("\n"); + } + } + } + } + + public static void writeBondCounters(SimulationContext simContext, StringBuilder sb) { + if(simContext == null) { + sb.append("\n"); + return; + } + if(simContext.getApplicationType() != Application.SPRINGSALAD) { + sb.append("\n"); + return; + } + ReactionContext reactionContext = simContext.getReactionContext(); + ReactionRuleSpec[] reactionRuleSpecs = reactionContext.getReactionRuleSpecs(); + for(ReactionRuleSpec rrs : reactionRuleSpecs) { + if(rrs.isExcluded()) { + continue; + } + Map analysisResults = new LinkedHashMap<> (); + rrs.analizeReaction(analysisResults); + Subtype subtype = rrs.getSubtype(analysisResults); + if(subtype == ReactionRuleSpec.Subtype.BINDING) { + sb.append("'").append(rrs.getReactionRule().getName()).append("' : ") // was ("' : '") + .append("Counted"); + sb.append("\n"); + } + } + } + + public static void writeSitePropertyCounters(SimulationContext simContext, StringBuilder sb) { + if(simContext == null) { + sb.append("\n"); + return; + } + if(simContext.getApplicationType() != Application.SPRINGSALAD) { + sb.append("\n"); + return; + } + Model model = simContext.getBioModel().getModel(); + SpeciesContext[] speciesContexts = model.getSpeciesContexts(); + for(SpeciesContext sc : speciesContexts) { + SpeciesPattern sp = sc.getSpeciesPattern(); + if(sp == null || sp.getMolecularTypePatterns() == null || sp.getMolecularTypePatterns().isEmpty()) { + continue; + } + MolecularType mt = sp.getMolecularTypePatterns().get(0).getMolecularType(); + List mcList = mt.getComponentList(); + for(MolecularComponent mc : mcList) { + sb.append("'").append(mt.getName()).append("' ") + .append("Site " + (mc.getIndex()-1)).append(" : ") + .append("Track Properties true"); + sb.append("\n"); + } + } + } + } + +private Simulation( ) { +} +/** + * One of three ways to construct a Simulation. This constructor + * is used when creating a new Simulation. + */ +public Simulation(SimulationVersion argSimulationVersion, MathDescription mathDescription, SimulationOwner simulationOwner) { + this( ); + addVetoableChangeListener(this); + this.fieldSimulationVersion = argSimulationVersion; + if (fieldSimulationVersion != null) { + if (fieldSimulationVersion.getParentSimulationReference()!=null){ + this.fieldSimulationIdentifier = null; + }else{ + this.fieldSimulationIdentifier = createSimulationID(fieldSimulationVersion.getVersionKey()); + } + } + + this.fieldName = argSimulationVersion.getName(); + this.fieldDescription = argSimulationVersion.getAnnot(); + this.simulationOwner = simulationOwner; + + try { + setMathDescription(mathDescription); + } catch (java.beans.PropertyVetoException e) { + throw new RuntimeException(e.getMessage(), e); + } + // Must set the MathDescription before constructing these... + if (mathDescription.getGeometry().getDimension()>0){ + fieldMeshSpecification = new MeshSpecification(mathDescription.getGeometry()); + } + fieldMathOverrides = new MathOverrides(this); + fieldSolverTaskDescription = new SolverTaskDescription(this); + refreshDependencies(); +} + + +/** + * One of three ways to construct a Simulation. This constructor + * is used when creating a Simulation from the database. + */ +public Simulation(SimulationVersion simulationVersion, MathDescription mathDescription, CommentStringTokenizer mathOverridesTokenizer, CommentStringTokenizer solverTaskDescriptionTokenizer) throws DataAccessException, PropertyVetoException { + this( ); + addVetoableChangeListener(this); + + fieldSimulationVersion = simulationVersion; + if (simulationVersion!=null){ + fieldName = simulationVersion.getName(); + fieldDescription = simulationVersion.getAnnot(); + if (simulationVersion.getParentSimulationReference()!=null){ + fieldSimulationIdentifier = null; + }else{ + fieldSimulationIdentifier = createSimulationID(simulationVersion.getVersionKey()); + } + } + if (mathDescription != null){ + setMathDescription(mathDescription); + if (mathDescription.getGeometry().getDimension()>0){ + fieldMeshSpecification = new MeshSpecification(mathDescription.getGeometry()); + } + } + // Must set the MathDescription before constructing these... + fieldMathOverrides = new MathOverrides(this, mathOverridesTokenizer); + fieldSolverTaskDescription = new SolverTaskDescription(this, solverTaskDescriptionTokenizer); + refreshDependencies(); +} + + +/** + * One of three ways to construct a Simulation. This constructor + * is used when creating a new Simulation. + */ +public Simulation(MathDescription mathDescription, SimulationOwner simulationOwner) { + this( ); + addVetoableChangeListener(this); + + try { + setMathDescription(mathDescription); + } catch (java.beans.PropertyVetoException e) { + throw new RuntimeException(e.getMessage(), e); + } + fieldName = mathDescription.getName()+"_"+Math.random(); + this.simulationOwner = simulationOwner; + // Must set the MathDescription before constructing these... + if (mathDescription.getGeometry().getDimension()>0){ + fieldMeshSpecification = new MeshSpecification(mathDescription.getGeometry()); + } + fieldMathOverrides = new MathOverrides(this); + fieldSolverTaskDescription = new SolverTaskDescription(this); + +} + + +/** + * One of three ways to construct a Simulation. This constructor + * is used when copying a Simulation from an existing one. + */ +public Simulation(Simulation simulation) { + this(simulation,false); +} + + +/** + * One of three ways to construct a Simulation. This constructor + * is used when copying a Simulation from an existing one. + */ +public Simulation(Simulation simulation, boolean bCloneMath) { + this( ); + addVetoableChangeListener(this); + + fieldImportedTaskID = simulation.getImportedTaskID(); + fieldSimulationVersion = null; + fieldName = simulation.getName(); + fieldDescription = simulation.getDescription(); + fieldSimulationIdentifier = null; + if (bCloneMath){ + fieldMathDescription = new MathDescription(simulation.getMathDescription()); + }else{ + fieldMathDescription = simulation.getMathDescription(); + } + if (simulation.getMeshSpecification()!=null){ + fieldMeshSpecification = new MeshSpecification(simulation.getMeshSpecification()); + }else{ + fieldMeshSpecification = null; + } + simulationOwner = simulation.getSimulationOwner(); + // Must set the MathDescription before constructing these... + fieldMathOverrides = new MathOverrides (this, simulation.getMathOverrides()); + fieldSolverTaskDescription = new SolverTaskDescription(this, simulation.getSolverTaskDescription()); + dataProcessingInstructions = simulation.dataProcessingInstructions; + fieldImportedTaskID = simulation.fieldImportedTaskID; + + refreshDependencies(); +} + + +public SimulationOwner getSimulationOwner() { + return simulationOwner; +} + + +public void setSimulationOwner(SimulationOwner simulationOwner) { + this.simulationOwner = simulationOwner; +} + + +/** + * The addPropertyChangeListener method was generated to support the propertyChange field. + */ +public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener listener) { + getPropertyChange().addPropertyChangeListener(listener); +} + +/** + * The addVetoableChangeListener method was generated to support the vetoPropertyChange field. + */ +public synchronized void addVetoableChangeListener(java.beans.VetoableChangeListener listener) { + getVetoPropertyChange().addVetoableChangeListener(listener); +} + +/** + * Insert the method's description here. + * Creation date: (4/24/2003 3:33:12 PM) + */ +public void clearVersion() { + fieldSimulationVersion = null; +} + + +/** + * compareEqual method comment. + */ +public boolean compareEqual(Matchable object) { + if (this == object) { + return (true); + } + if (object != null && object instanceof Simulation) { + Simulation simulation = (Simulation) object; + // + // check for content + // + if (!compareEqualMathematically(simulation)){ + return false; + } + // + // check for true equality + // + if (!Compare.isEqual(getName(),simulation.getName())){ + return false; + } + if (!Compare.isEqualOrNull(getDescription(),simulation.getDescription())){ + return false; + } + return true; + } + return false; + +} + + +/** + * compareEqual method comment. + */ +private boolean compareEqualMathematically(Simulation simulation) { + if (this == simulation) { + return true; + } + if (!getMathDescription().compareEqual(simulation.getMathDescription())) return (false); + if (!getMathOverrides().compareEqual(simulation.getMathOverrides())) return (false); + if (!getSolverTaskDescription().compareEqual(simulation.getSolverTaskDescription())) return (false); + if (!Compare.isEqualOrNull(getMeshSpecification(),simulation.getMeshSpecification())) return (false); + if (!Compare.isEqualOrNull(dataProcessingInstructions, simulation.dataProcessingInstructions)) return (false); + + return true; +} + +public static String createSimulationID(KeyValue simKey) { + return "SimID_"+simKey; +} + + +/** + * The firePropertyChange method was generated to support the propertyChange field. + */ +public void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue) { + getPropertyChange().firePropertyChange(propertyName, oldValue, newValue); +} + + +/** + * The fireVetoableChange method was generated to support the vetoPropertyChange field. + */ +public void fireVetoableChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue) throws java.beans.PropertyVetoException { + getVetoPropertyChange().fireVetoableChange(propertyName, oldValue, newValue); +} + + +public void forceNewVersionAnnotation(SimulationVersion newSimulationVersion) throws PropertyVetoException { + if (getVersion().getVersionKey().equals(newSimulationVersion.getVersionKey())) { + setVersion(newSimulationVersion); + } else { + throw new RuntimeException("Simulation.forceNewVersionAnnotation failed : version keys not equal"); + } +} + + +public java.lang.String getDescription() { + return fieldDescription; +} + + +public boolean getIsDirty() { + return fieldIsDirty; +} + +/** + * Gets the isSpatial property (boolean) value. + * @return {@link #fieldMathDescription#isSpatial()} + */ +public boolean isSpatial() { + assert fieldMathDescription != null ; + return fieldMathDescription.isSpatial(); +} + + +//public void gatherIssues(IssueContext issueContext, List issueList) { +// +// getMathOverrides().gatherIssues(issueContext, issueList); +// +// // +// // Check if the math corresponding to this simulation has fast systems and if the solverTaskDescription contains a non-null sensitivity parameter. +// // If so, the simulation is invalid. +// // +// if (fieldMathDescription != null && getSolverTaskDescription() != null) { +// if (getMathDescription().hasFastSystems() && (getSolverTaskDescription().getSensitivityParameter() != null)) { +// Issue issue = new Issue(this, issueContext, IssueCategory.Simulation_SensAnal_And_FastSystem, +// VCellErrorMessages.getErrorMessage(VCellErrorMessages.SIMULATION_SENSANAL_FASTSYSTEM,getName()), +// Issue.SEVERITY_ERROR); +// issueList.add(issue); +// } +// } +// if (fieldMathDescription==null || !fieldMathDescription.isValid()){ +// Issue issue = new Issue(this, issueContext, IssueCategory.MathDescription_MathException,fieldMathDescription.getWarning(),Issue.SEVERITY_ERROR); +// issueList.add(issue); +// } +// +// Set supportedFeatures = getSolverTaskDescription().getSolverDescription().getSupportedFeatures(); +// Set missingFeatures = getRequiredFeatures(); +// missingFeatures.removeAll(supportedFeatures); +// +// String text = "The selected Solver does not support the following required features: \n"; +// for (SolverFeature sf : missingFeatures) { +// text += sf.getName() + "\n"; +// } +// +// if (!missingFeatures.isEmpty()) { +// System.out.println(this.getKey()); +// String tooltip = "The selected Solver " + getSolverTaskDescription().getSolverDescription().getDisplayLabel() + +// " does not support the following required features:
"; +// for (SolverFeature sf : missingFeatures) { +// tooltip += "   " + sf.getName() + "
"; +// } +// CollectiongoodSolvers = SolverDescription.getSolverDescriptions(getRequiredFeatures()); +// assert goodSolvers != null; +// if (!goodSolvers.isEmpty()) { +// tooltip += "Please choose one of the solvers :
"; +// for (SolverDescription sd : goodSolvers) { +// tooltip += "   " + sd.getDisplayLabel() + "
"; +// } +// } +// Issue issue = new Issue(this,issueContext, IssueCategory.MathDescription_MathException, text, tooltip, Issue.SEVERITY_ERROR); +// issueList.add(issue); +// } +//} + +// this doesn't seem to be called anywhere, we deprecate it (also, it doesn't know about Feature_Springs) +// jul 2023 danv +@Deprecated +public Set getRequiredFeatures() { + Set requiredFeatures = new HashSet(); + final MathDescription md = getMathDescription(); + if (isSpatial()) { + requiredFeatures.add(SolverFeature.Feature_Spatial); + } else { + requiredFeatures.add(SolverFeature.Feature_NonSpatial); + } + + final boolean hybrid = md.isSpatialHybrid(); + final boolean stoch = md.isNonSpatialStoch() || md.isSpatialStoch(); + final boolean ruleBased = md.isRuleBased(); + if (hybrid) { + requiredFeatures.add(SolverFeature.Feature_Hybrid); + } + if (stoch && !hybrid) { + requiredFeatures.add(SolverFeature.Feature_Stochastic); + } + if (!stoch && !ruleBased) { + requiredFeatures.add(SolverFeature.Feature_Deterministic); + } + if (md.hasFastSystems()) { + requiredFeatures.add(SolverFeature.Feature_FastSystem); + } + if (md.hasPeriodicBoundaryCondition()) { + requiredFeatures.add(SolverFeature.Feature_PeriodicBoundaryCondition); + } + if (md.hasEvents()) { + requiredFeatures.add(SolverFeature.Feature_Events); + } + if (md.hasRandomVariables()) { + requiredFeatures.add(SolverFeature.Feature_RandomVariables); + } + if (getSolverTaskDescription().getStopAtSpatiallyUniformErrorTolerance() != null) { + requiredFeatures.add(SolverFeature.Feature_StopAtSpatiallyUniform); + } + if (getDataProcessingInstructions() != null) { + requiredFeatures.add(SolverFeature.Feature_DataProcessingInstructions); + } + if (md.getVariable(PSF_FUNCTION_NAME) != null) { + requiredFeatures.add(SolverFeature.Feature_PSF); + } + if (isSerialParameterScan()) { + requiredFeatures.add(SolverFeature.Feature_SerialParameterScans); + } + if (md.hasVolumeRegionEquations()) { + requiredFeatures.add(SolverFeature.Feature_VolumeRegionEquations); + } + if (md.hasRegionSizeFunctions()) { + requiredFeatures.add(SolverFeature.Feature_RegionSizeFunctions); + } + if (md.hasGradient()) { + requiredFeatures.add(SolverFeature.Feature_GradientSourceTerm); + } + if (md.getPostProcessingBlock().getNumDataGenerators() > 0) { + requiredFeatures.add(SolverFeature.Feature_PostProcessingBlock); + } + if (md.isRuleBased()){ + requiredFeatures.add(SolverFeature.Feature_Rulebased); + } + return requiredFeatures; +} +/** + * Insert the method's description here. + * Creation date: (10/24/00 1:36:01 PM) + * @return cbit.sql.KeyValue + */ +public KeyValue getKey() { + return (getVersion()!=null)?(getVersion().getVersionKey()):(null); +} + + +/** + * Gets the mathDescription property (cbit.vcell.math.MathDescription) value. + * @return The mathDescription property value. + */ +public MathDescription getMathDescription() { + return fieldMathDescription; +} + + +/** + * Gets the mathOverrides property (cbit.vcell.solver.MathOverrides) value. + * @return The mathOverrides property value. + */ +public MathOverrides getMathOverrides() { + return fieldMathOverrides; +} + + +/** + * Gets the meshSpecification property (cbit.vcell.mesh.MeshSpecification) value. + * @return The meshSpecification property value. + * @see #setMeshSpecification + */ +public MeshSpecification getMeshSpecification() { + return fieldMeshSpecification; +} + + +/** + * Gets the name property (java.lang.String) value. + * @return The name property value. + * @see #setName + */ +public java.lang.String getName() { + return fieldName; +} + + +/** + * Accessor for the propertyChange field. + */ +protected java.beans.PropertyChangeSupport getPropertyChange() { + if (propertyChange == null) { + propertyChange = new java.beans.PropertyChangeSupport(this); + }; + return propertyChange; +} + + +/** + * Insert the method's description here. + * Creation date: (10/5/2005 1:02:08 PM) + * @return int + */ +public int getScanCount() { + return getMathOverrides().getScanCount(); +} + + +/** + * Gets the simulationIdentifier property (java.lang.String) value. + * @return The simulationIdentifier property value. + */ +public java.lang.String getSimulationID() { + return fieldSimulationIdentifier; +} + + +/** + * Insert the method's description here. + * Creation date: (10/30/00 11:48:21 AM) + * @return cbit.vcell.solver.simulation.SimulationInfo + */ +public SimulationInfo getSimulationInfo() { + if (getVersion() != null) { + return new SimulationInfo( + getMathDescription().getKey(), + getSimulationVersion(),null); + } else { + return null; + } +} + + +/** + * Insert the method's description here. + * Creation date: (10/24/00 1:34:10 PM) + * @return cbit.sql.Version + */ +public SimulationVersion getSimulationVersion() { + return fieldSimulationVersion; +} + + +/** + * Gets the solverTaskDescription property (cbit.vcell.solver.SolverTaskDescription) value. + * @return The solverTaskDescription property value. + * @see #setSolverTaskDescription + */ +public SolverTaskDescription getSolverTaskDescription() { + return fieldSolverTaskDescription; +} + + +/** + * Insert the method's description here. + * Creation date: (10/30/00 11:56:03 AM) + * @return java.lang.String + */ +public String getVCML() throws MathException { + + StringBuffer buffer = new StringBuffer(); + + String name = (getVersion()!=null)?(getVersion().getName()):"unnamedSimulation"; + buffer.append(VCML.Simulation+" "+name+" {\n"); + + // + // write MathDescription + // + buffer.append(VCML.MathDescription+" "+getMathDescription().getVCML_database()+"\n"); + + // + // write SolverTaskDescription + // + buffer.append(getSolverTaskDescription().getVCML()+"\n"); + + // + // write SolverTaskDescription + // + buffer.append(getMathOverrides().getVCML()+"\n"); + + // + // write MeshSpecification + // + if (getMeshSpecification()!=null){ + buffer.append(getMeshSpecification().getVCML()+"\n"); + } + + buffer.append("}\n"); + return buffer.toString(); +} + + +/** + * Insert the method's description here. + * Creation date: (10/24/00 1:34:10 PM) + * @return cbit.sql.Version + */ +public Version getVersion() { + return fieldSimulationVersion; +} + + +/** + * Accessor for the vetoPropertyChange field. + */ +protected java.beans.VetoableChangeSupport getVetoPropertyChange() { + if (vetoPropertyChange == null) { + vetoPropertyChange = new java.beans.VetoableChangeSupport(this); + }; + return vetoPropertyChange; +} + + +/** + * The hasListeners method was generated to support the propertyChange field. + */ +public synchronized boolean hasListeners(java.lang.String propertyName) { + return getPropertyChange().hasListeners(propertyName); +} + +/** + * Insert the method's description here. + * Creation date: (5/11/01 4:00:35 PM) + */ +public void refreshDependencies() { + removeVetoableChangeListener(this); + addVetoableChangeListener(this); + if (getMeshSpecification()!=null){ + getMeshSpecification().refreshDependencies(); + } + getSolverTaskDescription().refreshDependencies(); + getMathOverrides().refreshDependencies(); + + getMathDescription().removePropertyChangeListener(this); + getMathDescription().addPropertyChangeListener(this); + +} + +/** + * The removePropertyChangeListener method was generated to support the propertyChange field. + */ +public synchronized void removePropertyChangeListener(java.beans.PropertyChangeListener listener) { + getPropertyChange().removePropertyChangeListener(listener); +} + +/** + * The removeVetoableChangeListener method was generated to support the vetoPropertyChange field. + */ +public synchronized void removeVetoableChangeListener(java.beans.VetoableChangeListener listener) { + getVetoPropertyChange().removeVetoableChangeListener(listener); +} + +/** + * Sets the description property (java.lang.String) value. + * @param description The new value for the property. + * @see #getDescription + */ +public void setDescription(java.lang.String description) throws java.beans.PropertyVetoException { + java.lang.String oldValue = fieldDescription; + fireVetoableChange("description", oldValue, description); + fieldDescription = description; + firePropertyChange("description", oldValue, description); +} + + +/** + * Sets the isDirty property (boolean) value. + * @param isDirty The new value for the property. + * @see #getIsDirty + */ +public void setIsDirty(boolean isDirty) { + boolean oldValue = fieldIsDirty; + fieldIsDirty = isDirty; + firePropertyChange("isDirty", oldValue, isDirty); +} + + +public void setMathDescription(MathDescription mathDescription) throws java.beans.PropertyVetoException { + MathDescription oldValue = fieldMathDescription; + fireVetoableChange("mathDescription", oldValue, mathDescription); + fieldMathDescription = mathDescription; + + if(oldValue != null){ + oldValue.removePropertyChangeListener(this); + } + if(fieldMathDescription != null){ + fieldMathDescription.removePropertyChangeListener(this); + fieldMathDescription.addPropertyChangeListener(this); + } + refreshMeshSpec(); + + // + // refresh MathOverrides + // + if (mathDescription!=null && getMathOverrides()!=null && oldValue != fieldMathDescription){ + getMathOverrides().updateFromMathDescription(true); + } + + // + // refresh SolverTaskDescription (reset if oldMath is spatial and newMath is non-spatial .... or opposite). + // + if (oldValue==null || mathDescription==null || oldValue.isSpatial()!=mathDescription.isSpatial()){ + fieldSolverTaskDescription = new SolverTaskDescription(this); + } + + firePropertyChange("mathDescription", oldValue, mathDescription); +} + + +public void setMathOverrides(MathOverrides mathOverrides) { + MathOverrides oldValue = fieldMathOverrides; + fieldMathOverrides = mathOverrides; + // update overrides + mathOverrides.setSimulation(this); + mathOverrides.updateFromMathDescription(false); + firePropertyChange("mathOverrides", oldValue, mathOverrides); +} + + +/** + * Sets the meshSpecification property (cbit.vcell.mesh.MeshSpecification) value. + * @param meshSpecification The new value for the property. + * @exception java.beans.PropertyVetoException The exception description. + * @see #getMeshSpecification + */ +public void setMeshSpecification(MeshSpecification meshSpecification) throws java.beans.PropertyVetoException { + MeshSpecification oldValue = fieldMeshSpecification; + fireVetoableChange("meshSpecification", oldValue, meshSpecification); + fieldMeshSpecification = meshSpecification; + firePropertyChange("meshSpecification", oldValue, meshSpecification); +} + + +/** + * Sets the name property (java.lang.String) value. + * @param name The new value for the property. + * @see #setName + */ +public void setName(java.lang.String name) throws java.beans.PropertyVetoException { + java.lang.String oldValue = fieldName; + fireVetoableChange(PropertyConstants.PROPERTY_NAME_NAME, oldValue, name); + fieldName = name; + firePropertyChange(PropertyConstants.PROPERTY_NAME_NAME, oldValue, name); +} + + +/** + * Sets the solverTaskDescription property (cbit.vcell.solver.SolverTaskDescription) value. + * @param solverTaskDescription The new value for the property. + * @exception java.beans.PropertyVetoException The exception description. + * @see #getSolverTaskDescription() + */ +public void setSolverTaskDescription(SolverTaskDescription solverTaskDescription) throws java.beans.PropertyVetoException { + SolverTaskDescription oldValue = fieldSolverTaskDescription; + fireVetoableChange(PROPERTY_NAME_SOLVER_TASK_DESCRIPTION, oldValue, solverTaskDescription); + fieldSolverTaskDescription = solverTaskDescription; + if (solverTaskDescription != null && solverTaskDescription.getSimulation() != this) { + throw new IllegalArgumentException("SolverTaskDescription simulation field points to wrong simulation"); + } + firePropertyChange(PROPERTY_NAME_SOLVER_TASK_DESCRIPTION, oldValue, solverTaskDescription); +} + + +private void setVersion(SimulationVersion simulationVersion) throws PropertyVetoException { + this.fieldSimulationVersion = simulationVersion; + if (simulationVersion != null){ + setName(simulationVersion.getName()); + setDescription(simulationVersion.getAnnot()); + } +} + +public static boolean testEquivalency(Simulation memorySimulation, Simulation databaseSimulation, MathCompareResults mathCompareResults) { + + if (memorySimulation == databaseSimulation){ + return true; + } + + if (!mathCompareResults.isEquivalent()){ + return false; + }else{ + if (!memorySimulation.getSolverTaskDescription().compareEqual(databaseSimulation.getSolverTaskDescription())){ + return false; + } + if (!Compare.isEqualOrNull(memorySimulation.getMeshSpecification(),databaseSimulation.getMeshSpecification())){ + return false; + } + // + // math overrides are only influence the solution if they actually override something. + // + // if maths are equal/equivalent and overridden parameters (where actual value != default value) are same + // then the MathDescriptions equality/equivalence is upheld. + // otherwise, they are always different + // + // if (!memorySimulation.getMathOverrides().compareEqualIgnoreDefaults(databaseSimulation.getMathOverrides())){ + // now only non-defaults are stored in overrides... + if (!memorySimulation.getMathOverrides().compareEquivalent(databaseSimulation.getMathOverrides())){ + return false; + } + return true; + } +} + + +public String toString() { + String mathStr = (getMathDescription()!=null)?("Math@"+Integer.toHexString(getMathDescription().hashCode())+"("+getMathDescription().getName()+","+getMathDescription().getKey()+")"):"null"; + return "Simulation@"+Integer.toHexString(hashCode())+"("+getName()+"), "+mathStr; +} + + + /** + * This method gets called when a constrained property is changed. + * + * @param evt a PropertyChangeEvent object describing the + * event source and the property that has changed. + * @exception PropertyVetoException if the recipient wishes the property + * change to be rolled back. + */ +public void vetoableChange(java.beans.PropertyChangeEvent evt) throws java.beans.PropertyVetoException { + TokenMangler.checkNameProperty(this, "simulation", evt); +} + + + public DataProcessingInstructions getDataProcessingInstructions() { + return dataProcessingInstructions; + } + + + public void setDataProcessingInstructions(DataProcessingInstructions dataProcessingInstructions) { + DataProcessingInstructions oldValue = this.dataProcessingInstructions; + this.dataProcessingInstructions = dataProcessingInstructions; + firePropertyChange("dataProcessingInstructions", oldValue, dataProcessingInstructions); +} + + public boolean isSerialParameterScan() { + if (getSolverTaskDescription().isSerialParameterScan() && getScanCount() > 1) { + return true; + } + return false; + } + public boolean isTimeoutDisabled() { + if (getSolverTaskDescription().isTimeoutDisabled()) { + return true; + } + return false; + } + public boolean isBorderExtrapolationDisabled() { + if (getSolverTaskDescription().isBorderExtrapolationDisabled()) { + return true; + } + return false; + } + + public void propertyChange(PropertyChangeEvent evt) { + MathDescription md = getMathDescription(); + boolean bIsMath = evt.getSource() == md; + if(bIsMath && evt.getPropertyName().equals("geometry")){ + try{ + refreshMeshSpec(); + }catch(PropertyVetoException e){ + throw new RuntimeException(e.getMessage(),e); + } + } + } + + private void refreshMeshSpec() throws PropertyVetoException{ + // + // refresh MeshSpecification + // + if (getMathDescription().getGeometry().getDimension()>0){ + if (getMeshSpecification()!=null){ + getMeshSpecification().setGeometry(getMathDescription().getGeometry()); + }else{ + setMeshSpecification(new MeshSpecification(getMathDescription().getGeometry())); + } + }else{ + setMeshSpecification(null); + } + } + + public boolean hasCellCenteredMesh() + { + return getSolverTaskDescription() != null && getSolverTaskDescription().getSolverDescription() != null + && getSolverTaskDescription().getSolverDescription().hasCellCenteredMesh(); + } + + public void gatherIssues(IssueContext issueContext, List issueList) { + + MathOverrides mo = getMathOverrides(); + if(mo!=null && mo.hasUnusedOverrides()) { + String msg = "The Simulation '" + getName() + "' has unused Math Overrides."; + String tip = "Remove the unused Math Overrides."; + issueList.add(new Issue(this, issueContext, IssueCategory.Simulation_Override_NotFound, msg, tip, Issue.Severity.ERROR)); + } + + SimulationWarning.gatherIssues(this, issueContext, issueList); + } + + @Override + public Kind getSimulationContextKind() { + return SimulationContext.Kind.SIMULATIONS_KIND; + } + public void setImportedTaskID(String id) { + fieldImportedTaskID = id; + } + public String getImportedTaskID() { + return fieldImportedTaskID; + } + + public static final String typeName = "Simulation"; + @Override + public String getDisplayName() { + return getName(); + } + @Override + public String getDisplayType() { + return typeName; + } +} diff --git a/vcell-core/src/main/java/cbit/vcell/solver/SimulationInfo.java b/vcell-core/src/main/java/cbit/vcell/solver/simulation/SimulationInfo.java similarity index 95% rename from vcell-core/src/main/java/cbit/vcell/solver/SimulationInfo.java rename to vcell-core/src/main/java/cbit/vcell/solver/simulation/SimulationInfo.java index 2f7b62b7ad..0024d67d5b 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/SimulationInfo.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/simulation/SimulationInfo.java @@ -1,170 +1,171 @@ -/* - * Copyright (C) 1999-2011 University of Connecticut Health Center - * - * Licensed under the MIT License (the "License"). - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.opensource.org/licenses/mit-license.php - */ - -package cbit.vcell.solver; -import java.io.Serializable; - -import org.vcell.util.document.KeyValue; -import org.vcell.util.document.SimulationVersion; -import org.vcell.util.document.User; -import org.vcell.util.document.VCellSoftwareVersion; -import org.vcell.util.document.Version; -import org.vcell.util.document.VersionInfo; -import org.vcell.util.document.VersionableType; - -/** - * This class was generated by a SmartGuide. - * - */ -public class SimulationInfo implements Serializable,VersionInfo { - private KeyValue mathRef = null; - private SimulationVersion simulationVersion = null; - private String simulationID = null; - private VCellSoftwareVersion softwareVersion = null; - -/** - * This method was created in VisualAge. - * @param argGeomRef KeyValue - * @param argVersion cbit.sql.Version - */ -public SimulationInfo(KeyValue argMathRef, SimulationVersion argSimulationVersion, VCellSoftwareVersion softwareVersion) { - super(); - if (argSimulationVersion==null){ - throw new IllegalArgumentException("version cannot be null"); - } - this.mathRef = argMathRef; - this.simulationVersion = argSimulationVersion; - this.softwareVersion = softwareVersion; -} - - -/** - * Insert the method's description here. - * Creation date: (1/25/01 12:24:41 PM) - * @return boolean - * @param object java.lang.Object - */ -public boolean equals(Object object) { - if (object instanceof SimulationInfo){ - if (!getVersion().getVersionKey().equals(((SimulationInfo)object).getVersion().getVersionKey())){ - return false; - } - return true; - } - return false; -} - - -/** - * Insert the method's description here. - * Creation date: (8/24/2004 1:18:11 PM) - * @return cbit.vcell.solver.VCSimulationIdentifier - */ -public VCSimulationIdentifier getAuthoritativeVCSimulationIdentifier() { - if (getParentSimulationReference()==null){ - return new VCSimulationIdentifier(getVersion().getVersionKey(),getVersion().getOwner()); - }else{ - return new VCSimulationIdentifier(getParentSimulationReference(),getVersion().getOwner()); - } -} - - -/** - * Gets the description property (java.lang.String) value. - * @return The description property value. - */ -public java.lang.String getDescription() { - return simulationVersion.getAnnot(); -} - - -/** - * This method was created in VisualAge. - * @return cbit.sql.KeyValue - */ -public KeyValue getMathRef() { - return mathRef; -} - - -/** - * Gets the name property (java.lang.String) value. - * @return The name property value. - */ -public java.lang.String getName() { - return simulationVersion.getName(); -} - - -/** - * This method was created in VisualAge. - * @return cbit.sql.Version - */ -public User getOwner() { - return simulationVersion.getOwner(); -} - - -/** - * Insert the method's description here. - * Creation date: (7/9/2004 1:43:29 PM) - * @return cbit.sql.KeyValue - */ -public KeyValue getParentSimulationReference() { - return simulationVersion.getParentSimulationReference(); -} - - -/** - * This method was created in VisualAge. - * @return cbit.sql.Version - */ -public SimulationVersion getSimulationVersion() { - return simulationVersion; -} - - -/** - * This method was created in VisualAge. - * @return cbit.sql.Version - */ -public Version getVersion() { - return simulationVersion; -} - - -/** - * Insert the method's description here. - * Creation date: (1/25/01 12:28:06 PM) - * @return int - */ -public int hashCode() { - return getVersion().getVersionKey().hashCode(); -} - - -/** - * This method was created in VisualAge. - * @return java.lang.String - */ -public String toString() { - return "SimulationInfo(mathRef="+mathRef+",SimulationID="+simulationID+",Version="+simulationVersion+")"; -} - - -public VersionableType getVersionType() { - return VersionableType.Simulation; -} - - -public VCellSoftwareVersion getSoftwareVersion() { - return softwareVersion; -} -} +/* + * Copyright (C) 1999-2011 University of Connecticut Health Center + * + * Licensed under the MIT License (the "License"). + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.opensource.org/licenses/mit-license.php + */ + +package cbit.vcell.solver.simulation; +import java.io.Serializable; + +import cbit.vcell.solver.VCSimulationIdentifier; +import org.vcell.util.document.KeyValue; +import org.vcell.util.document.SimulationVersion; +import org.vcell.util.document.User; +import org.vcell.util.document.VCellSoftwareVersion; +import org.vcell.util.document.Version; +import org.vcell.util.document.VersionInfo; +import org.vcell.util.document.VersionableType; + +/** + * This class was generated by a SmartGuide. + * + */ +public class SimulationInfo implements Serializable,VersionInfo { + private KeyValue mathRef = null; + private SimulationVersion simulationVersion = null; + private String simulationID = null; + private VCellSoftwareVersion softwareVersion = null; + +/** + * This method was created in VisualAge. + * @param argGeomRef KeyValue + * @param argVersion cbit.sql.Version + */ +public SimulationInfo(KeyValue argMathRef, SimulationVersion argSimulationVersion, VCellSoftwareVersion softwareVersion) { + super(); + if (argSimulationVersion==null){ + throw new IllegalArgumentException("version cannot be null"); + } + this.mathRef = argMathRef; + this.simulationVersion = argSimulationVersion; + this.softwareVersion = softwareVersion; +} + + +/** + * Insert the method's description here. + * Creation date: (1/25/01 12:24:41 PM) + * @return boolean + * @param object java.lang.Object + */ +public boolean equals(Object object) { + if (object instanceof SimulationInfo){ + if (!getVersion().getVersionKey().equals(((SimulationInfo)object).getVersion().getVersionKey())){ + return false; + } + return true; + } + return false; +} + + +/** + * Insert the method's description here. + * Creation date: (8/24/2004 1:18:11 PM) + * @return cbit.vcell.solver.VCSimulationIdentifier + */ +public VCSimulationIdentifier getAuthoritativeVCSimulationIdentifier() { + if (getParentSimulationReference()==null){ + return new VCSimulationIdentifier(getVersion().getVersionKey(),getVersion().getOwner()); + }else{ + return new VCSimulationIdentifier(getParentSimulationReference(),getVersion().getOwner()); + } +} + + +/** + * Gets the description property (java.lang.String) value. + * @return The description property value. + */ +public java.lang.String getDescription() { + return simulationVersion.getAnnot(); +} + + +/** + * This method was created in VisualAge. + * @return cbit.sql.KeyValue + */ +public KeyValue getMathRef() { + return mathRef; +} + + +/** + * Gets the name property (java.lang.String) value. + * @return The name property value. + */ +public java.lang.String getName() { + return simulationVersion.getName(); +} + + +/** + * This method was created in VisualAge. + * @return cbit.sql.Version + */ +public User getOwner() { + return simulationVersion.getOwner(); +} + + +/** + * Insert the method's description here. + * Creation date: (7/9/2004 1:43:29 PM) + * @return cbit.sql.KeyValue + */ +public KeyValue getParentSimulationReference() { + return simulationVersion.getParentSimulationReference(); +} + + +/** + * This method was created in VisualAge. + * @return cbit.sql.Version + */ +public SimulationVersion getSimulationVersion() { + return simulationVersion; +} + + +/** + * This method was created in VisualAge. + * @return cbit.sql.Version + */ +public Version getVersion() { + return simulationVersion; +} + + +/** + * Insert the method's description here. + * Creation date: (1/25/01 12:28:06 PM) + * @return int + */ +public int hashCode() { + return getVersion().getVersionKey().hashCode(); +} + + +/** + * This method was created in VisualAge. + * @return java.lang.String + */ +public String toString() { + return "SimulationInfo(mathRef="+mathRef+",SimulationID="+simulationID+",Version="+simulationVersion+")"; +} + + +public VersionableType getVersionType() { + return VersionableType.Simulation; +} + + +public VCellSoftwareVersion getSoftwareVersion() { + return softwareVersion; +} +} diff --git a/vcell-core/src/main/java/cbit/vcell/solver/SimulationJob.java b/vcell-core/src/main/java/cbit/vcell/solver/simulation/SimulationJob.java similarity index 93% rename from vcell-core/src/main/java/cbit/vcell/solver/SimulationJob.java rename to vcell-core/src/main/java/cbit/vcell/solver/simulation/SimulationJob.java index 6fda0a3f56..b0adab9d20 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/SimulationJob.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/simulation/SimulationJob.java @@ -1,138 +1,139 @@ -/* - * Copyright (C) 1999-2011 University of Connecticut Health Center - * - * Licensed under the MIT License (the "License"). - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.opensource.org/licenses/mit-license.php - */ - -package cbit.vcell.solver; -import org.vcell.util.Compare; -import org.vcell.util.Matchable; - -import cbit.vcell.field.FieldDataIdentifierSpec; - -public class SimulationJob implements java.io.Serializable, Matchable { - private Simulation sim = null; - private int jobIndex = -1; // expect non-negative value. - private FieldDataIdentifierSpec[] fieldDataIdentifierSpecs = null; - private transient SimulationSymbolTable simulationSymbolTable = null; - -/** - * Insert the method's description here. - * Creation date: (10/7/2005 4:50:05 PM) - * @param masterSim cbit.vcell.solver.Simulation - * @param jobIndex int - */ -public SimulationJob(Simulation argSim, int jobIndex, FieldDataIdentifierSpec[] argFDIS) { - if (jobIndex<0){ - throw new RuntimeException("unexpected simulation jobIndex < 0"); - } - sim = argSim; - fieldDataIdentifierSpecs = argFDIS; - this.jobIndex = jobIndex; -} - -/** - * Insert the method's description here. - * Creation date: (10/14/2005 12:09:29 PM) - * @return java.lang.String - */ -public static String createSimulationJobID(String simulationID, int jobIndex) { - return simulationID+"_"+jobIndex+"_"; -} - - -/** - * Insert the method's description here. - * Creation date: (9/20/2006 9:49:07 AM) - * @return cbit.vcell.field.FieldDataIdentifier[] - */ -public FieldDataIdentifierSpec[] getFieldDataIdentifierSpecs() { - return fieldDataIdentifierSpecs; -} - - -/** - * Insert the method's description here. - * Creation date: (10/7/2005 4:52:17 PM) - * @return int - */ -public int getJobIndex() { - return jobIndex; -} - - -/** - * Insert the method's description here. - * Creation date: (10/14/2005 12:09:29 PM) - * @return java.lang.String - */ -public String getSimulationJobID() { - String simid = sim.getSimulationID(); - if (simid == null) { - // try to see if a sed-ml task - simid = sim.getImportedTaskID(); - } - return createSimulationJobID(simid,jobIndex); -} - - -/** - * Insert the method's description here. - * Creation date: (10/14/2005 11:45:42 AM) - * @return cbit.vcell.server.VCDataIdentifier - */ -public VCSimulationDataIdentifier getVCDataIdentifier() { - return new VCSimulationDataIdentifier(sim.getSimulationInfo().getAuthoritativeVCSimulationIdentifier(), jobIndex); -} - - -/** - * Insert the method's description here. - * Creation date: (10/7/2005 4:48:57 PM) - * @return cbit.vcell.solver.Simulation - */ -public Simulation getSimulation() { - return sim; -} - - -public final SimulationSymbolTable getSimulationSymbolTable() { - if (simulationSymbolTable == null) { - simulationSymbolTable = new SimulationSymbolTable(sim, jobIndex); - } - return simulationSymbolTable; -} - -public boolean compareEqual(Matchable obj) { - if (obj instanceof SimulationJob){ - SimulationJob other = (SimulationJob)obj; - if (!Compare.isEqual(getSimulation(), other.getSimulation())){ - return false; - } - if (!Compare.isEqual(getJobIndex(), other.getJobIndex())){ - return false; - } - FieldDataIdentifierSpec[] thisFDIS = null; - if (this.fieldDataIdentifierSpecs!=null && this.fieldDataIdentifierSpecs.length>0){ - thisFDIS = this.fieldDataIdentifierSpecs; - } - FieldDataIdentifierSpec[] otherFDIS = null; - if (other.fieldDataIdentifierSpecs!=null && other.fieldDataIdentifierSpecs.length>0){ - otherFDIS = other.fieldDataIdentifierSpecs; - } - if (!Compare.isEqualOrNull(thisFDIS,otherFDIS)){ - return false; - } - return true; - } - return false; -} - -public int numProcessors( ) { - return sim.getSolverTaskDescription().getNumProcessors(); //CBN? -} -} +/* + * Copyright (C) 1999-2011 University of Connecticut Health Center + * + * Licensed under the MIT License (the "License"). + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.opensource.org/licenses/mit-license.php + */ + +package cbit.vcell.solver.simulation; +import cbit.vcell.solver.VCSimulationDataIdentifier; +import org.vcell.util.Compare; +import org.vcell.util.Matchable; + +import cbit.vcell.field.FieldDataIdentifierSpec; + +public class SimulationJob implements java.io.Serializable, Matchable { + private Simulation sim = null; + private int jobIndex = -1; // expect non-negative value. + private FieldDataIdentifierSpec[] fieldDataIdentifierSpecs = null; + private transient SimulationSymbolTable simulationSymbolTable = null; + +/** + * Insert the method's description here. + * Creation date: (10/7/2005 4:50:05 PM) + * @param masterSim cbit.vcell.solver.simulation.Simulation + * @param jobIndex int + */ +public SimulationJob(Simulation argSim, int jobIndex, FieldDataIdentifierSpec[] argFDIS) { + if (jobIndex<0){ + throw new RuntimeException("unexpected simulation jobIndex < 0"); + } + sim = argSim; + fieldDataIdentifierSpecs = argFDIS; + this.jobIndex = jobIndex; +} + +/** + * Insert the method's description here. + * Creation date: (10/14/2005 12:09:29 PM) + * @return java.lang.String + */ +public static String createSimulationJobID(String simulationID, int jobIndex) { + return simulationID+"_"+jobIndex+"_"; +} + + +/** + * Insert the method's description here. + * Creation date: (9/20/2006 9:49:07 AM) + * @return cbit.vcell.field.FieldDataIdentifier[] + */ +public FieldDataIdentifierSpec[] getFieldDataIdentifierSpecs() { + return fieldDataIdentifierSpecs; +} + + +/** + * Insert the method's description here. + * Creation date: (10/7/2005 4:52:17 PM) + * @return int + */ +public int getJobIndex() { + return jobIndex; +} + + +/** + * Insert the method's description here. + * Creation date: (10/14/2005 12:09:29 PM) + * @return java.lang.String + */ +public String getSimulationJobID() { + String simid = sim.getSimulationID(); + if (simid == null) { + // try to see if a sed-ml task + simid = sim.getImportedTaskID(); + } + return createSimulationJobID(simid,jobIndex); +} + + +/** + * Insert the method's description here. + * Creation date: (10/14/2005 11:45:42 AM) + * @return cbit.vcell.server.VCDataIdentifier + */ +public VCSimulationDataIdentifier getVCDataIdentifier() { + return new VCSimulationDataIdentifier(sim.getSimulationInfo().getAuthoritativeVCSimulationIdentifier(), jobIndex); +} + + +/** + * Insert the method's description here. + * Creation date: (10/7/2005 4:48:57 PM) + * @return cbit.vcell.solver.simulation.Simulation + */ +public Simulation getSimulation() { + return sim; +} + + +public final SimulationSymbolTable getSimulationSymbolTable() { + if (simulationSymbolTable == null) { + simulationSymbolTable = new SimulationSymbolTable(sim, jobIndex); + } + return simulationSymbolTable; +} + +public boolean compareEqual(Matchable obj) { + if (obj instanceof SimulationJob){ + SimulationJob other = (SimulationJob)obj; + if (!Compare.isEqual(getSimulation(), other.getSimulation())){ + return false; + } + if (!Compare.isEqual(getJobIndex(), other.getJobIndex())){ + return false; + } + FieldDataIdentifierSpec[] thisFDIS = null; + if (this.fieldDataIdentifierSpecs!=null && this.fieldDataIdentifierSpecs.length>0){ + thisFDIS = this.fieldDataIdentifierSpecs; + } + FieldDataIdentifierSpec[] otherFDIS = null; + if (other.fieldDataIdentifierSpecs!=null && other.fieldDataIdentifierSpecs.length>0){ + otherFDIS = other.fieldDataIdentifierSpecs; + } + if (!Compare.isEqualOrNull(thisFDIS,otherFDIS)){ + return false; + } + return true; + } + return false; +} + +public int numProcessors( ) { + return sim.getSolverTaskDescription().getNumProcessors(); //CBN? +} +} diff --git a/vcell-core/src/main/java/cbit/vcell/solver/SimulationMetadata.java b/vcell-core/src/main/java/cbit/vcell/solver/simulation/SimulationMetadata.java similarity index 94% rename from vcell-core/src/main/java/cbit/vcell/solver/SimulationMetadata.java rename to vcell-core/src/main/java/cbit/vcell/solver/simulation/SimulationMetadata.java index 3e607652e3..9009810f2c 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/SimulationMetadata.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/simulation/SimulationMetadata.java @@ -1,81 +1,83 @@ -/* - * Copyright (C) 1999-2011 University of Connecticut Health Center - * - * Licensed under the MIT License (the "License"). - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.opensource.org/licenses/mit-license.php - */ - -package cbit.vcell.solver; -import java.io.Serializable; - -import org.vcell.util.document.User; - -/** - * Insert the type's description here. - * Creation date: (9/3/2003 10:39:26 AM) - * @author: Fei Gao - */ -public class SimulationMetadata implements Serializable { - public final VCSimulationIdentifier vcSimID; - public final String simname; - public final User owner; - public final SolverTaskDescription solverTaskDesc; - public final Integer meshSpecX; - public final Integer meshSpecY; - public final Integer meshSpecZ; - public final Integer scanCount; - - /** - * SimpleJobStatus constructor comment. - */ -public SimulationMetadata(VCSimulationIdentifier vcSimID, String simname, User owner, SolverTaskDescription arg_solverTaskDesc, Integer meshSpecX, Integer meshSpecY, Integer meshSpecZ, Integer scanCount) { - super(); - this.vcSimID = vcSimID; - this.simname = simname; - this.owner = owner; - this.solverTaskDesc = arg_solverTaskDesc; - this.meshSpecX = meshSpecX; - this.meshSpecY = meshSpecY; - this.meshSpecZ = meshSpecZ; - this.scanCount = scanCount; -} - -public String getSolverDescriptionVCML() { - if (solverTaskDesc == null) { - return "Error: Null Solver Description"; - } - return solverTaskDesc.getVCML(); -} - -public String getMeshSampling(){ - if (this.meshSpecX==null){ - return "no mesh"; - }else if (this.meshSpecY!=null){ - if (this.meshSpecZ!=null){ - return "mesh ("+meshSpecX.intValue()+","+meshSpecY.intValue()+","+meshSpecZ.intValue()+") = "+getMeshSize()+" volume elements"; - }else{ - return "mesh ("+meshSpecX.intValue()+","+meshSpecY.intValue()+") = "+getMeshSize()+" volume elements"; - } - }else{ - return "mesh ("+meshSpecX.intValue()+") = "+getMeshSize()+" volume elements"; - } -} - -public long getMeshSize(){ - if (meshSpecX!=null){ - long size = meshSpecX.intValue(); - if (meshSpecY!=null){ - size *= meshSpecY.intValue(); - } - if (meshSpecZ!=null){ - size *= meshSpecZ.intValue(); - } - return size; - }else{ - return 0; - } -} -} +/* + * Copyright (C) 1999-2011 University of Connecticut Health Center + * + * Licensed under the MIT License (the "License"). + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.opensource.org/licenses/mit-license.php + */ + +package cbit.vcell.solver.simulation; +import java.io.Serializable; + +import cbit.vcell.solver.SolverTaskDescription; +import cbit.vcell.solver.VCSimulationIdentifier; +import org.vcell.util.document.User; + +/** + * Insert the type's description here. + * Creation date: (9/3/2003 10:39:26 AM) + * @author: Fei Gao + */ +public class SimulationMetadata implements Serializable { + public final VCSimulationIdentifier vcSimID; + public final String simname; + public final User owner; + public final SolverTaskDescription solverTaskDesc; + public final Integer meshSpecX; + public final Integer meshSpecY; + public final Integer meshSpecZ; + public final Integer scanCount; + + /** + * SimpleJobStatus constructor comment. + */ +public SimulationMetadata(VCSimulationIdentifier vcSimID, String simname, User owner, SolverTaskDescription arg_solverTaskDesc, Integer meshSpecX, Integer meshSpecY, Integer meshSpecZ, Integer scanCount) { + super(); + this.vcSimID = vcSimID; + this.simname = simname; + this.owner = owner; + this.solverTaskDesc = arg_solverTaskDesc; + this.meshSpecX = meshSpecX; + this.meshSpecY = meshSpecY; + this.meshSpecZ = meshSpecZ; + this.scanCount = scanCount; +} + +public String getSolverDescriptionVCML() { + if (solverTaskDesc == null) { + return "Error: Null Solver Description"; + } + return solverTaskDesc.getVCML(); +} + +public String getMeshSampling(){ + if (this.meshSpecX==null){ + return "no mesh"; + }else if (this.meshSpecY!=null){ + if (this.meshSpecZ!=null){ + return "mesh ("+meshSpecX.intValue()+","+meshSpecY.intValue()+","+meshSpecZ.intValue()+") = "+getMeshSize()+" volume elements"; + }else{ + return "mesh ("+meshSpecX.intValue()+","+meshSpecY.intValue()+") = "+getMeshSize()+" volume elements"; + } + }else{ + return "mesh ("+meshSpecX.intValue()+") = "+getMeshSize()+" volume elements"; + } +} + +public long getMeshSize(){ + if (meshSpecX!=null){ + long size = meshSpecX.intValue(); + if (meshSpecY!=null){ + size *= meshSpecY.intValue(); + } + if (meshSpecZ!=null){ + size *= meshSpecZ.intValue(); + } + return size; + }else{ + return 0; + } +} +} diff --git a/vcell-core/src/main/java/cbit/vcell/solver/SimulationModelInfo.java b/vcell-core/src/main/java/cbit/vcell/solver/simulation/SimulationModelInfo.java similarity index 94% rename from vcell-core/src/main/java/cbit/vcell/solver/SimulationModelInfo.java rename to vcell-core/src/main/java/cbit/vcell/solver/simulation/SimulationModelInfo.java index 4de327839a..d74d4cc58d 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/SimulationModelInfo.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/simulation/SimulationModelInfo.java @@ -1,54 +1,55 @@ -/* - * Copyright (C) 1999-2011 University of Connecticut Health Center - * - * Licensed under the MIT License (the "License"). - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.opensource.org/licenses/mit-license.php - */ - -package cbit.vcell.solver; - -import java.util.HashMap; - -import cbit.vcell.parser.SymbolTableEntry; - - -/** - * Insert the type's description here. - * Creation date: (9/19/2005 1:26:40 PM) - * @author: Ion Moraru - */ -public interface SimulationModelInfo { - - public interface ModelCategoryType { - // uses == semantics, must be implemented by an enumeration - String getName(); - boolean isInitialSelect(); - boolean isEnabled(); - } - - public interface DataSymbolMetadataResolver { - - DataSymbolMetadata getDataSymbolMetadata(SymbolTableEntry ste); - - DataSymbolMetadata getDataSymbolMetadata(String symbolName); - - ModelCategoryType[] getUniqueFilterCategories(); - - void populateDataSymbolMetadata(HashMap auxMap); - } - - String getContextName(); - - String getMembraneName(int subVolumeIdIn, int subVolumeIdOut, boolean bFromGeometry); - - String getSimulationName(); - - String getVolumeNamePhysiology(int subVolumeID); - - String getVolumeNameGeometry(int subVolumeID); - - DataSymbolMetadataResolver getDataSymbolMetadataResolver(); -} +/* + * Copyright (C) 1999-2011 University of Connecticut Health Center + * + * Licensed under the MIT License (the "License"). + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.opensource.org/licenses/mit-license.php + */ + +package cbit.vcell.solver.simulation; + +import java.util.HashMap; + +import cbit.vcell.parser.SymbolTableEntry; +import cbit.vcell.solver.DataSymbolMetadata; + + +/** + * Insert the type's description here. + * Creation date: (9/19/2005 1:26:40 PM) + * @author: Ion Moraru + */ +public interface SimulationModelInfo { + + public interface ModelCategoryType { + // uses == semantics, must be implemented by an enumeration + String getName(); + boolean isInitialSelect(); + boolean isEnabled(); + } + + public interface DataSymbolMetadataResolver { + + DataSymbolMetadata getDataSymbolMetadata(SymbolTableEntry ste); + + DataSymbolMetadata getDataSymbolMetadata(String symbolName); + + ModelCategoryType[] getUniqueFilterCategories(); + + void populateDataSymbolMetadata(HashMap auxMap); + } + + String getContextName(); + + String getMembraneName(int subVolumeIdIn, int subVolumeIdOut, boolean bFromGeometry); + + String getSimulationName(); + + String getVolumeNamePhysiology(int subVolumeID); + + String getVolumeNameGeometry(int subVolumeID); + + DataSymbolMetadataResolver getDataSymbolMetadataResolver(); +} diff --git a/vcell-core/src/main/java/cbit/vcell/solver/SimulationOwner.java b/vcell-core/src/main/java/cbit/vcell/solver/simulation/SimulationOwner.java similarity index 94% rename from vcell-core/src/main/java/cbit/vcell/solver/SimulationOwner.java rename to vcell-core/src/main/java/cbit/vcell/solver/simulation/SimulationOwner.java index 640a6ac73e..4c90b6d365 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/SimulationOwner.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/simulation/SimulationOwner.java @@ -1,124 +1,125 @@ -/* - * Copyright (C) 1999-2011 University of Connecticut Health Center - * - * Licensed under the MIT License (the "License"). - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.opensource.org/licenses/mit-license.php - */ - -package cbit.vcell.solver; -import java.beans.PropertyChangeListener; -import java.beans.PropertyVetoException; -import java.util.Map; - -import cbit.vcell.geometry.Geometry; -import org.vcell.util.Issue; -import org.vcell.util.IssueContext; - -import cbit.vcell.geometry.GeometryOwner; -import cbit.vcell.math.MathDescription; -/** - * Insert the type's description here. - * Creation date: (6/4/2004 1:56:12 AM) - * @author: Ion Moraru - */ -public interface SimulationOwner extends GeometryOwner { - - public static class StandaloneSimulationOwner implements SimulationOwner { - - @Override - public Geometry getGeometry() { - return null; - } - - @Override - public void addPropertyChangeListener(PropertyChangeListener listener) { - - } - - @Override - public void removePropertyChangeListener(PropertyChangeListener listener) { - - } - - @Override - public Simulation copySimulation(Simulation simulation) throws PropertyVetoException { - return null; - } - - @Override - public Simulation[] getSimulations() { - return new Simulation[0]; - } - - @Override - public void removeSimulation(Simulation simulation) throws PropertyVetoException { - - } - - @Override - public OutputFunctionContext getOutputFunctionContext() { - return null; - } - - @Override - public MathOverridesResolver getMathOverridesResolver() { - return null; - } - - @Override - public MathDescription getMathDescription() { - return null; - } - - @Override - public String getName() { - return null; - } - - @Override - public Issue gatherIssueForMathOverride(IssueContext issueContext, Simulation simulation, String overriddenConstantName) { - return null; - } - - @Override - public UnitInfo getUnitInfo() throws UnsupportedOperationException { - return null; - } - } - public static String DEFAULT_SIM_NAME_PREFIX = "Simulation"; - public interface FieldDataSimOwner extends SimulationOwner{} // Typed simulationOwner for FieldData - - Simulation copySimulation(Simulation simulation) throws PropertyVetoException; - Simulation[] getSimulations(); - void removeSimulation(Simulation simulation) throws PropertyVetoException; - OutputFunctionContext getOutputFunctionContext(); - MathOverridesResolver getMathOverridesResolver(); - MathDescription getMathDescription(); - String getName(); - public Issue gatherIssueForMathOverride(IssueContext issueContext, Simulation simulation, String overriddenConstantName); - - /** - * @return UnitInfo (not null) - * @throws UnsupportedOperationException if not implemented - */ - public UnitInfo getUnitInfo( ) throws UnsupportedOperationException; - /** - * provide unit information for display purposes - */ - public static class UnitInfo { - private final String timeUnitString; - - public UnitInfo(String timeUnitString) { - super(); - this.timeUnitString = timeUnitString; - } - - public String getTimeUnitString() { - return timeUnitString; - } - } -} - +/* + * Copyright (C) 1999-2011 University of Connecticut Health Center + * + * Licensed under the MIT License (the "License"). + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.opensource.org/licenses/mit-license.php + */ + +package cbit.vcell.solver.simulation; +import java.beans.PropertyChangeListener; +import java.beans.PropertyVetoException; + +import cbit.vcell.geometry.Geometry; +import cbit.vcell.solver.MathOverridesResolver; +import cbit.vcell.solver.OutputFunctionContext; +import org.vcell.util.Issue; +import org.vcell.util.IssueContext; + +import cbit.vcell.geometry.GeometryOwner; +import cbit.vcell.math.MathDescription; +/** + * Insert the type's description here. + * Creation date: (6/4/2004 1:56:12 AM) + * @author: Ion Moraru + */ +public interface SimulationOwner extends GeometryOwner { + + public static class StandaloneSimulationOwner implements SimulationOwner { + + @Override + public Geometry getGeometry() { + return null; + } + + @Override + public void addPropertyChangeListener(PropertyChangeListener listener) { + + } + + @Override + public void removePropertyChangeListener(PropertyChangeListener listener) { + + } + + @Override + public Simulation copySimulation(Simulation simulation) throws PropertyVetoException { + return null; + } + + @Override + public Simulation[] getSimulations() { + return new Simulation[0]; + } + + @Override + public void removeSimulation(Simulation simulation) throws PropertyVetoException { + + } + + @Override + public OutputFunctionContext getOutputFunctionContext() { + return null; + } + + @Override + public MathOverridesResolver getMathOverridesResolver() { + return null; + } + + @Override + public MathDescription getMathDescription() { + return null; + } + + @Override + public String getName() { + return null; + } + + @Override + public Issue gatherIssueForMathOverride(IssueContext issueContext, Simulation simulation, String overriddenConstantName) { + return null; + } + + @Override + public UnitInfo getUnitInfo() throws UnsupportedOperationException { + return null; + } + } + public static String DEFAULT_SIM_NAME_PREFIX = "Simulation"; + public interface FieldDataSimOwner extends SimulationOwner{} // Typed simulationOwner for FieldData + + Simulation copySimulation(Simulation simulation) throws PropertyVetoException; + Simulation[] getSimulations(); + void removeSimulation(Simulation simulation) throws PropertyVetoException; + OutputFunctionContext getOutputFunctionContext(); + MathOverridesResolver getMathOverridesResolver(); + MathDescription getMathDescription(); + String getName(); + public Issue gatherIssueForMathOverride(IssueContext issueContext, Simulation simulation, String overriddenConstantName); + + /** + * @return UnitInfo (not null) + * @throws UnsupportedOperationException if not implemented + */ + public UnitInfo getUnitInfo( ) throws UnsupportedOperationException; + /** + * provide unit information for display purposes + */ + public static class UnitInfo { + private final String timeUnitString; + + public UnitInfo(String timeUnitString) { + super(); + this.timeUnitString = timeUnitString; + } + + public String getTimeUnitString() { + return timeUnitString; + } + } +} + diff --git a/vcell-core/src/main/java/cbit/vcell/solver/SimulationSymbolTable.java b/vcell-core/src/main/java/cbit/vcell/solver/simulation/SimulationSymbolTable.java similarity index 97% rename from vcell-core/src/main/java/cbit/vcell/solver/SimulationSymbolTable.java rename to vcell-core/src/main/java/cbit/vcell/solver/simulation/SimulationSymbolTable.java index 986b523dcf..38a321331c 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/SimulationSymbolTable.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/simulation/SimulationSymbolTable.java @@ -1,702 +1,702 @@ -/* - * Copyright (C) 1999-2011 University of Connecticut Health Center - * - * Licensed under the MIT License (the "License"). - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.opensource.org/licenses/mit-license.php - */ - -package cbit.vcell.solver; - -import java.util.*; - -import cbit.vcell.mapping.SimulationContext; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.vcell.util.BeanUtils; - -import cbit.vcell.field.FieldFunctionArguments; -import cbit.vcell.field.FieldUtilities; -import cbit.vcell.mapping.DiffEquMathMapping; -import cbit.vcell.mapping.MappingException; -import cbit.vcell.math.Constant; -import cbit.vcell.math.Equation; -import cbit.vcell.math.FilamentRegionVariable; -import cbit.vcell.math.FilamentVariable; -import cbit.vcell.math.Function; -import cbit.vcell.math.InconsistentDomainException; -import cbit.vcell.math.InsideVariable; -import cbit.vcell.math.MathDescription; -import cbit.vcell.math.MathException; -import cbit.vcell.math.MathFunctionDefinitions; -import cbit.vcell.math.MathSymbolTable; -import cbit.vcell.math.MathSymbolTableFactory; -import cbit.vcell.math.MathUtilities; -import cbit.vcell.math.MemVariable; -import cbit.vcell.math.MembraneRegionVariable; -import cbit.vcell.math.MembraneSubDomain; -import cbit.vcell.math.OutsideVariable; -import cbit.vcell.math.ParticleVariable; -import cbit.vcell.math.PdeEquation; -import cbit.vcell.math.PointVariable; -import cbit.vcell.math.ReservedVariable; -import cbit.vcell.math.SubDomain; -import cbit.vcell.math.Variable; -import cbit.vcell.math.VariableType; -import cbit.vcell.math.VariableType.VariableDomain; -import cbit.vcell.math.VolVariable; -import cbit.vcell.math.VolumeRegionVariable; -import cbit.vcell.parser.AbstractNameScope; -import cbit.vcell.parser.Expression; -import cbit.vcell.parser.ExpressionBindingException; -import cbit.vcell.parser.ExpressionException; -import cbit.vcell.parser.FunctionInvocation; -import cbit.vcell.parser.NameScope; -import cbit.vcell.parser.ScopedSymbolTable; -import cbit.vcell.parser.SymbolTableEntry; -import cbit.vcell.solver.AnnotatedFunction.FunctionCategory; - -/** - * Specifies the problem to be solved by a solver. - * It is subclassed for each type of problem/solver. - * Creation date: (8/16/2000 11:08:33 PM) - * - * @author: John Wagner - */ -public class SimulationSymbolTable implements ScopedSymbolTable, MathSymbolTable { - private final static Logger lg = LogManager.getLogger(SimulationSymbolTable.class); - - private Simulation simulation = null; - // - private transient HashMap localVariableHash = null; - /** - * Field for multiplexing and spawning job arrays - * Working sims created when necessarry with appropriate index - */ - private int index = 0; - private NameScope nameScope = new SimulationNameScope(); - - @SuppressWarnings("serial") - public class SimulationNameScope extends AbstractNameScope { - public SimulationNameScope(){ - super(); - } - - @Override - public NameScope[] getChildren(){ - return null; - } - - @Override - public String getName(){ - return simulation.getName(); - } - - @Override - public NameScope getParent(){ - return null; - } - - @Override - public ScopedSymbolTable getScopedSymbolTable(){ - return SimulationSymbolTable.this; - } - - } - - /** - * One of three ways to construct a Simulation. This constructor - * is used when creating a new Simulation. - */ - public SimulationSymbolTable(Simulation arg_simulation, int arg_index){ - super(); - simulation = arg_simulation; - index = arg_index; - rebindAll(); // especially needed to bind Constants so that .substitute() will eliminate Constants that are functions of other Constants. - } - - public final Simulation getSimulation(){ - return simulation; - } - - public final MathDescription getMathDescription(){ - return simulation.getMathDescription(); - } - - /** - * getEntry method comment. - */ - public SymbolTableEntry getEntry(java.lang.String identifierString){ - // - // use MathDescription as the primary SymbolTable, just replace the Constants with the overrides. - // - SymbolTableEntry ste = simulation.getMathDescription().getEntry(identifierString); - if(ste instanceof Constant cons){ - try { - return getLocalConstant(cons); - } catch(ExpressionException e){ - throw new RuntimeException("Simulation.getEntry(), error getting local Constant (math override)" + identifierString, e); - } - } else if(ste instanceof Function func){ - try { - return getLocalFunction(func); - } catch(ExpressionException e){ - throw new RuntimeException("Simulation.getEntry(), error getting local Function " + identifierString + ", " + e.getMessage(), e); - } - } else { - return ste; - } - } - - public void applyOverrides(MathDescription newMath) throws ExpressionException, MappingException, MathException{ - - // - // replace original constants with "Simulation" constants - // - Enumeration newMathVariables = newMath.getVariables(); - if(newMathVariables == null) throw new NullPointerException(); - Variable[] newVarArray = Collections.list(newMathVariables).toArray(Variable[]::new); - for(int i = 0; i < newVarArray.length; i++){ - if(!(newVarArray[i] instanceof Constant constant)) continue; - Constant simConstant = getLocalConstant(constant); - newVarArray[i] = new Constant(constant.getName(), new Expression(simConstant.getExpression())); - } - newMath.setAllVariables(newVarArray); - } - - /** - * Insert the method's description here. - * Creation date: (5/25/01 11:34:08 AM) - * - * @return cbit.vcell.math.Variable[] - */ - public Function[] getFunctions(){ - - Vector functList = new Vector<>(); - - // - // get all variables from MathDescription, but replace MathOverrides - // - Variable[] variables = getVariables(); - for(Variable variable : variables){ - if(variable instanceof Function var){ - functList.addElement(var); - } - } - - return functList.toArray(Function[]::new); - } - - - public Constant getLocalConstant(Constant referenceConstant) throws ExpressionException{ - if(localVariableHash == null){ - localVariableHash = new HashMap(); - } - Variable var = localVariableHash.get(referenceConstant.getName()); - if(var instanceof Constant localConstant){ - - // - // make sure expression for localConstant is still up to date with MathOverrides table - // - Expression exp = simulation.getMathOverrides().getActualExpression(referenceConstant.getName(), index); - if(exp.compareEqual(localConstant.getExpression())){ - //localConstant.bind(this); // update bindings to latest mathOverrides - return localConstant; - } else { - // - // MathOverride's Expression changed for this Constant, remove and create new one - // - localVariableHash.remove(localConstant.getName()); - } - } else if(var != null){ - throw new RuntimeException("Variable " + var + " expected to be a Constant"); - } - // - // if local Constant not found, create new one, bind it to the Simulation (which ensures MathOverrides), and add to list - // - String name = referenceConstant.getName(); - Constant newLocalConstant = new Constant(name, simulation.getMathOverrides().getActualExpression(name, index)); - //newLocalConstant.bind(this); - localVariableHash.put(newLocalConstant.getName(), newLocalConstant); - return newLocalConstant; - } - - - private Function getLocalFunction(Function referenceFunction) throws ExpressionException{ - if(localVariableHash == null){ - localVariableHash = new HashMap(); - } - Variable var = localVariableHash.get(referenceFunction.getName()); - if(var instanceof Function){ - Function localFunction = (Function) var; - if(localFunction.compareEqual(referenceFunction)){ - //localFunction.bind(this); // update bindings to latest mathOverrides - return localFunction; - } - } else if(var != null){ - throw new RuntimeException("Variable " + var + " expected to be a Function"); - } - // - // if local Function not found, create new one, bind it to the Simulation (which ensures MathOverrides), and add to list - // - Function newLocalFunction = new Function(referenceFunction.getName(), referenceFunction.getExpression(), referenceFunction.getDomain()); - //newLocalFunction.bind(this); - localVariableHash.put(newLocalFunction.getName(), newLocalFunction); - - return newLocalFunction; - } - - - /** - * This method was created by a SmartGuide. - * - * @param exp cbit.vcell.parser.Expression - * @return java.util.Enumeration - */ - public Enumeration getRequiredVariables(Expression exp) throws MathException, ExpressionException{ - return MathUtilities.getRequiredVariables(exp, this); - } - - - /** - * Insert the method's description here. - * Creation date: (5/25/01 12:31:53 PM) - * - * @param variableName java.lang.String - * @return cbit.vcell.math.Variable - */ - public Variable getVariable(String variableName){ - return (Variable) getEntry(variableName); - } - - - /** - * Insert the method's description here. - * Creation date: (5/25/01 11:34:08 AM) - * - * @return cbit.vcell.math.Variable[] - */ - public Variable[] getVariables(){ - - Vector varList = new Vector(); - - // - // get all variables from MathDescription, but replace MathOverrides - // - Enumeration enum1 = simulation.getMathDescription().getVariables(); - while (enum1.hasMoreElements()) { - Variable mathDescriptionVar = enum1.nextElement(); - // - // replace all Constants with math overrides - // - if(mathDescriptionVar instanceof Constant){ - try { - Constant overriddenConstant = getLocalConstant((Constant) mathDescriptionVar); - varList.addElement(overriddenConstant); - } catch(ExpressionException e){ - throw new RuntimeException("local Constant " + mathDescriptionVar.getName() + " not found for Simulation", e); - } - // - // replace all Functions with local Functions that are bound to this Simulation - // - } else if(mathDescriptionVar instanceof Function){ - try { - Function overriddenFunction = getLocalFunction((Function) mathDescriptionVar); - varList.addElement(overriddenFunction); - } catch(ExpressionException e){ - throw new RuntimeException("local Function " + mathDescriptionVar.getName() + " not found for Simulation", e); - } - // - // pass all other Variables through - // - } else { - varList.addElement(mathDescriptionVar); - } - } - - return varList.toArray(Variable[]::new); - } - - - /** - * Insert the method's description here. - * Creation date: (6/20/01 12:35:46 PM) - */ - private void rebindAll(){ - // - // cleanup - // - if(localVariableHash != null){ - localVariableHash.clear(); - } - - // reload - getVariables(); - - // - // bind all Variables, since now all the variables are sorted alphabetically - // a constant might be function of other constants which have not bound yet. - // so we need to first bind all then evaluate. - // - if(localVariableHash != null){ - for(Variable variable : localVariableHash.values()){ - try { - variable.bind(this); // update bindings to latest mathOverrides - } catch(ExpressionBindingException e){ - lg.error(e); - } - } - } - } - - - /** - * This method was created in VisualAge. - * - * @param exp cbit.vcell.parser.Expression - * @return cbit.vcell.parser.Expression - * @throws java.lang.Exception The exception description. - */ - public Expression substituteFunctions(Expression exp) throws MathException, ExpressionException{ - return MathUtilities.substituteFunctions(exp, this); - } - - - public void getEntries(Map entryMap){ - simulation.getMathDescription().getEntries(entryMap); - entryMap.putAll(localVariableHash); - } - - - public void getLocalEntries(Map entryMap){ - getEntries(entryMap); - } - - - public SymbolTableEntry getLocalEntry(String identifier){ - return getEntry(identifier); - } - - - public NameScope getNameScope(){ - return nameScope; - } - - - public boolean hasTimeVaryingDiffusionOrAdvection() throws MathException, ExpressionException{ - for(Variable var : getVariables()){ - if(hasTimeVaryingDiffusionOrAdvection(var)){ - return true; - } - } - return false; - } - - public boolean hasTimeVaryingDiffusionOrAdvection(Variable variable) throws MathException, ExpressionException{ - - Enumeration enum1 = simulation.getMathDescription().getSubDomains(); - while (enum1.hasMoreElements()) { - SubDomain subDomain = enum1.nextElement(); - Equation equation = subDomain.getEquation(variable); - // - // get diffusion expressions, see if function of time or volume variables - // - if(equation instanceof PdeEquation){ - Vector spatialExpressionList = new Vector(); - spatialExpressionList.add(((PdeEquation) equation).getDiffusionExpression()); - if(((PdeEquation) equation).getVelocityX() != null){ - spatialExpressionList.add(((PdeEquation) equation).getVelocityX()); - } - if(((PdeEquation) equation).getVelocityY() != null){ - spatialExpressionList.add(((PdeEquation) equation).getVelocityY()); - } - if(((PdeEquation) equation).getVelocityZ() != null){ - spatialExpressionList.add(((PdeEquation) equation).getVelocityZ()); - } - for(int i = 0; i < spatialExpressionList.size(); i++){ - Expression spatialExp = spatialExpressionList.elementAt(i); - spatialExp = substituteFunctions(spatialExp); - String symbols[] = spatialExp.getSymbols(); - if(symbols != null){ - for(int j = 0; j < symbols.length; j++){ - SymbolTableEntry entry = spatialExp.getSymbolBinding(symbols[j]); - if(entry instanceof ReservedVariable){ - if(((ReservedVariable) entry).isTIME()){ - return true; - } - } - if(entry instanceof VolVariable){ - return true; - } - if(entry instanceof VolumeRegionVariable){ - return true; - } - if(entry instanceof MemVariable || entry instanceof MembraneRegionVariable){ - return true; - } - } - } - } - } - } - return false; - } - - /** - * Insert the method's description here. - * Creation date: (6/6/2001 10:57:51 AM) - * - * @param function cbit.vcell.math.Function - * @return boolean - */ - public static boolean isFunctionSaved(Function function){ - String name = function.getName(); - if(!name.startsWith("Kflux_") && -// !name.endsWith(MathMapping.MATH_FUNC_SUFFIX_SPECIES_INIT_CONCENTRATION_molecule_per_um2) && -// !name.endsWith(MathMapping.MATH_FUNC_SUFFIX_SPECIES_INIT_CONCENTRATION_uM) && - !(name.endsWith(DiffEquMathMapping.PARAMETER_MASS_CONSERVATION_SUFFIX) && name.startsWith(DiffEquMathMapping.PARAMETER_MASS_CONSERVATION_PREFIX)) && - !name.equals(Simulation.PSF_FUNCTION_NAME)){ - return true; - } else { - return false; - } - } - - public Vector createAnnotatedFunctionsList(MathDescription mathDescription) throws InconsistentDomainException{ - // Get the list of (volVariables) in the simulation. Needed to determine 'type' of functions - boolean bSpatial = getSimulation().isSpatial(); - String[] variableNames = null; - VariableType[] variableTypes = null; - - if(bSpatial){ - Variable[] allVariables = getVariables(); - Vector varVector = new Vector(); - for(int i = 0; i < allVariables.length; i++){ - if((allVariables[i] instanceof VolVariable) - || (allVariables[i] instanceof VolumeRegionVariable) - || (allVariables[i] instanceof MemVariable) - || (allVariables[i] instanceof MembraneRegionVariable) - || (allVariables[i] instanceof FilamentVariable) - || (allVariables[i] instanceof FilamentRegionVariable) - || (allVariables[i] instanceof PointVariable) - || (allVariables[i] instanceof ParticleVariable) - || (allVariables[i] instanceof InsideVariable) - || (allVariables[i] instanceof OutsideVariable)){ - varVector.addElement(allVariables[i]); - } else if(allVariables[i] instanceof Constant || - (allVariables[i] instanceof Function)){ - } else { - System.err.println("SimulationSymbolTable.createAnnotatedFunctionsList() found unexpected variable type " + allVariables[i].getClass().getSimpleName() + " in spatial simulation"); - } - } - variableNames = new String[varVector.size()]; - for(int i = 0; i < variableNames.length; i++){ - variableNames[i] = varVector.get(i).getName(); - } - - // Lookup table for variableType for each variable in 'variables' array. - variableTypes = new VariableType[variableNames.length]; - for(int i = 0; i < variableNames.length; i++){ - variableTypes[i] = VariableType.getVariableType(varVector.get(i)); - } - } - // - // Bind and substitute functions to simulation before storing them in the '.functions' file - // - Function[] functions = getFunctions(); - Vector annotatedFunctionVector = new Vector(); - for(int i = 0; i < functions.length; i++){ - if(isFunctionSaved(functions[i])){ - String errString = ""; - VariableType funcType = null; - try { - Expression substitutedExp = substituteFunctions(functions[i].getExpression()); - substitutedExp.bindExpression(this); - functions[i].setExpression(substitutedExp.flatten()); - } catch(MathException | ExpressionException e){ - lg.error(e); - errString = errString + ", " + e.getMessage(); - // throw new RuntimeException(e.getMessage()); - } - - // - // get function's data type from the types of it's identifiers - // - funcType = bSpatial ? getFunctionVariableType(functions[i], mathDescription, variableNames, variableTypes, bSpatial) : VariableType.NONSPATIAL; - - AnnotatedFunction annotatedFunc = new AnnotatedFunction(functions[i].getName(), functions[i].getExpression(), functions[i].getDomain(), errString, funcType, FunctionCategory.PREDEFINED); - annotatedFunctionVector.addElement(annotatedFunc); - } - } - - - return annotatedFunctionVector; - } - - /** - * Insert the method's description here. - * Creation date: (2/19/2004 11:17:15 AM) - * - * @param function cbit.vcell.math.Function - * @param variableNames java.lang.String[] - * @param variableTypes cbit.vcell.simdata.VariableType[] - * @return cbit.vcell.simdata.VariableType - */ - public static VariableType getFunctionVariableType(Function function, MathDescription mathDescription, - String[] variableNames, VariableType[] variableTypes, boolean isSpatial) throws InconsistentDomainException{ - if(!isSpatial){ - return VariableType.NONSPATIAL; - } - VariableType domainFuncType = null; - // initial guess, restrict variable type to be consistent with domain. - if(function.getDomain() != null){ - String domainName = function.getDomain().getName(); - if(mathDescription != null){ - SubDomain subdomain = mathDescription.getSubDomain(domainName); - if(subdomain instanceof MembraneSubDomain){ - domainFuncType = VariableType.MEMBRANE_REGION; - } else { - domainFuncType = VariableType.VOLUME_REGION; - } - } - } - - Expression exp = function.getExpression(); - String symbols[] = exp.getSymbols(); - ArrayList varTypeList = new ArrayList(); - boolean bExplicitFunctionOfSpace = false; - if(symbols != null){ - for(int j = 0; j < symbols.length; j++){ - if(symbols[j].equals(ReservedVariable.X.getName()) || - symbols[j].equals(ReservedVariable.Y.getName()) || - symbols[j].equals(ReservedVariable.Z.getName())){ - bExplicitFunctionOfSpace = true; - continue; - } - for(int k = 0; k < variableNames.length; k++){ - if(symbols[j].equals(variableNames[k])){ - varTypeList.add(variableTypes[k]); - break; - } else if(symbols[j].equals(variableNames[k] + InsideVariable.INSIDE_VARIABLE_SUFFIX) - || symbols[j].equals(variableNames[k] + OutsideVariable.OUTSIDE_VARIABLE_SUFFIX)){ - if(variableTypes[k].equals(VariableType.VOLUME)){ - varTypeList.add(VariableType.MEMBRANE); - } else if(variableTypes[k].equals(VariableType.VOLUME_REGION)){ - varTypeList.add(VariableType.MEMBRANE_REGION); - } - break; - } - } - } - } - - // Size Functions - Set sizeFunctionInvocationSet = SolverUtilities.getSizeFunctionInvocations(function.getExpression()); - for(FunctionInvocation fi : sizeFunctionInvocationSet){ - String functionName = fi.getFunctionName(); - if(functionName.equals(MathFunctionDefinitions.Function_regionArea_current.getFunctionName())){ - varTypeList.add(VariableType.MEMBRANE_REGION); - } else if(functionName.equals(MathFunctionDefinitions.Function_regionVolume_current.getFunctionName())){ - varTypeList.add(VariableType.VOLUME_REGION); - } - } - - // Membrane Normal Functions - FunctionInvocation[] functionInvocations = function.getExpression().getFunctionInvocations(null); - for(FunctionInvocation fi : functionInvocations){ - String functionName = fi.getFunctionName(); - if(functionName.equals(MathFunctionDefinitions.Function_normalX.getFunctionName()) - || functionName.equals(MathFunctionDefinitions.Function_normalY.getFunctionName())){ - varTypeList.add(VariableType.MEMBRANE); - } - } - - FieldFunctionArguments[] fieldFuncArgs = FieldUtilities.getFieldFunctionArguments(function.getExpression()); - if(fieldFuncArgs != null && fieldFuncArgs.length > 0){ - varTypeList.add(fieldFuncArgs[0].getVariableType()); - } - - VariableType funcType = domainFuncType; - for(VariableType vt : varTypeList){ - if(funcType == null){ - funcType = vt; - } else { - // - // example: if VOLUME_REGION and VOLUME data are used in same function, - // then function must be evaluated at each volume index (hence VOLUME wins). - // - if(vt.isExpansionOf(funcType)){ - funcType = vt; - } else if(vt.equals(VariableType.VOLUME)){ - if(funcType.equals(VariableType.MEMBRANE_REGION)){ - funcType = VariableType.MEMBRANE; - } - } else if(vt.equals(VariableType.VOLUME_REGION)){ - - } else if(vt.equals(VariableType.MEMBRANE)){ - if(domainFuncType != null && domainFuncType.getVariableDomain().equals(VariableDomain.VARIABLEDOMAIN_VOLUME)){ - throw new InconsistentDomainException("Function '" + function.getName() + "' defined on a volume subdomain '" + function.getDomain().getName() - + "' references a variable or a function defined on a membrane subdomain"); - } - } else if(vt.equals(VariableType.MEMBRANE_REGION)){ - if(funcType.equals(VariableType.VOLUME)){ - if(domainFuncType != null && domainFuncType.getVariableDomain().equals(VariableDomain.VARIABLEDOMAIN_VOLUME)){ - throw new InconsistentDomainException("Function '" + function.getName() + "' defined on '" + function.getDomain().getName() - + "' references a size function defined on a membrane"); - } - funcType = VariableType.MEMBRANE; - } else if(funcType.equals(VariableType.VOLUME_REGION)){ - if(domainFuncType != null && domainFuncType.getVariableDomain().equals(VariableDomain.VARIABLEDOMAIN_VOLUME)){ - throw new InconsistentDomainException("Function '" + function.getName() + "' defined on '" + function.getDomain().getName() - + "' references a size function defined on a membrane"); - } - funcType = VariableType.MEMBRANE_REGION; - } - } else if(vt.incompatibleWith(funcType)){ - throw new InconsistentDomainException("Function domains conflict between variable domains '" + vt.getDefaultLabel() + "' and '" + funcType.getDefaultLabel() + " for function " + function.getName()); - } - } - } - - // - // if determined to be a volume region or membrane region function, - // then if it is an explicit function of space, promote type to corresponding non-region type (e.g. volRegion --> volume) - // - if(funcType != null && bExplicitFunctionOfSpace){ - if(funcType.equals(VariableType.MEMBRANE_REGION)){ - funcType = VariableType.MEMBRANE; - } else if(funcType.equals(VariableType.VOLUME_REGION)){ - funcType = VariableType.VOLUME; - } else if(funcType.equals(VariableType.CONTOUR_REGION)){ - funcType = VariableType.CONTOUR; - } - } - - if(funcType == null){ - if(variableTypes != null && variableTypes.length > 0){ - Set variableTypeSet = new LinkedHashSet<>(); - for(VariableType vt : variableTypes){ - variableTypeSet.add(vt); - } - if(variableTypeSet.size() != 1){ - return VariableType.VOLUME; - } else { - return variableTypeSet.iterator().next(); - } - } - return VariableType.VOLUME; // no knowledge from expression, default variable type - } - - return funcType; - } - - public static MathSymbolTableFactory createMathSymbolTableFactory(){ - return new MathSymbolTableFactory() { - public MathSymbolTable createMathSymbolTable(MathDescription newMath){ - return new SimulationSymbolTable(new Simulation(newMath, null), 0); - } - }; - } -} +/* + * Copyright (C) 1999-2011 University of Connecticut Health Center + * + * Licensed under the MIT License (the "License"). + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.opensource.org/licenses/mit-license.php + */ + +package cbit.vcell.solver.simulation; + +import java.util.*; + +import cbit.vcell.solver.AnnotatedFunction; +import cbit.vcell.solver.SolverUtilities; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import cbit.vcell.field.FieldFunctionArguments; +import cbit.vcell.field.FieldUtilities; +import cbit.vcell.mapping.DiffEquMathMapping; +import cbit.vcell.mapping.MappingException; +import cbit.vcell.math.Constant; +import cbit.vcell.math.Equation; +import cbit.vcell.math.FilamentRegionVariable; +import cbit.vcell.math.FilamentVariable; +import cbit.vcell.math.Function; +import cbit.vcell.math.InconsistentDomainException; +import cbit.vcell.math.InsideVariable; +import cbit.vcell.math.MathDescription; +import cbit.vcell.math.MathException; +import cbit.vcell.math.MathFunctionDefinitions; +import cbit.vcell.math.MathSymbolTable; +import cbit.vcell.math.MathSymbolTableFactory; +import cbit.vcell.math.MathUtilities; +import cbit.vcell.math.MemVariable; +import cbit.vcell.math.MembraneRegionVariable; +import cbit.vcell.math.MembraneSubDomain; +import cbit.vcell.math.OutsideVariable; +import cbit.vcell.math.ParticleVariable; +import cbit.vcell.math.PdeEquation; +import cbit.vcell.math.PointVariable; +import cbit.vcell.math.ReservedVariable; +import cbit.vcell.math.SubDomain; +import cbit.vcell.math.Variable; +import cbit.vcell.math.VariableType; +import cbit.vcell.math.VariableType.VariableDomain; +import cbit.vcell.math.VolVariable; +import cbit.vcell.math.VolumeRegionVariable; +import cbit.vcell.parser.AbstractNameScope; +import cbit.vcell.parser.Expression; +import cbit.vcell.parser.ExpressionBindingException; +import cbit.vcell.parser.ExpressionException; +import cbit.vcell.parser.FunctionInvocation; +import cbit.vcell.parser.NameScope; +import cbit.vcell.parser.ScopedSymbolTable; +import cbit.vcell.parser.SymbolTableEntry; +import cbit.vcell.solver.AnnotatedFunction.FunctionCategory; + +/** + * Specifies the problem to be solved by a solver. + * It is subclassed for each type of problem/solver. + * Creation date: (8/16/2000 11:08:33 PM) + * + * @author: John Wagner + */ +public class SimulationSymbolTable implements ScopedSymbolTable, MathSymbolTable { + private final static Logger lg = LogManager.getLogger(SimulationSymbolTable.class); + + private Simulation simulation = null; + // + private transient HashMap localVariableHash = null; + /** + * Field for multiplexing and spawning job arrays + * Working sims created when necessarry with appropriate index + */ + private int index = 0; + private NameScope nameScope = new SimulationNameScope(); + + @SuppressWarnings("serial") + public class SimulationNameScope extends AbstractNameScope { + public SimulationNameScope(){ + super(); + } + + @Override + public NameScope[] getChildren(){ + return null; + } + + @Override + public String getName(){ + return simulation.getName(); + } + + @Override + public NameScope getParent(){ + return null; + } + + @Override + public ScopedSymbolTable getScopedSymbolTable(){ + return SimulationSymbolTable.this; + } + + } + + /** + * One of three ways to construct a Simulation. This constructor + * is used when creating a new Simulation. + */ + public SimulationSymbolTable(Simulation arg_simulation, int arg_index){ + super(); + simulation = arg_simulation; + index = arg_index; + rebindAll(); // especially needed to bind Constants so that .substitute() will eliminate Constants that are functions of other Constants. + } + + public final Simulation getSimulation(){ + return simulation; + } + + public final MathDescription getMathDescription(){ + return simulation.getMathDescription(); + } + + /** + * getEntry method comment. + */ + public SymbolTableEntry getEntry(java.lang.String identifierString){ + // + // use MathDescription as the primary SymbolTable, just replace the Constants with the overrides. + // + SymbolTableEntry ste = simulation.getMathDescription().getEntry(identifierString); + if(ste instanceof Constant cons){ + try { + return getLocalConstant(cons); + } catch(ExpressionException e){ + throw new RuntimeException("Simulation.getEntry(), error getting local Constant (math override)" + identifierString, e); + } + } else if(ste instanceof Function func){ + try { + return getLocalFunction(func); + } catch(ExpressionException e){ + throw new RuntimeException("Simulation.getEntry(), error getting local Function " + identifierString + ", " + e.getMessage(), e); + } + } else { + return ste; + } + } + + public void applyOverrides(MathDescription newMath) throws ExpressionException, MappingException, MathException{ + + // + // replace original constants with "Simulation" constants + // + Enumeration newMathVariables = newMath.getVariables(); + if(newMathVariables == null) throw new NullPointerException(); + Variable[] newVarArray = Collections.list(newMathVariables).toArray(Variable[]::new); + for(int i = 0; i < newVarArray.length; i++){ + if(!(newVarArray[i] instanceof Constant constant)) continue; + Constant simConstant = getLocalConstant(constant); + newVarArray[i] = new Constant(constant.getName(), new Expression(simConstant.getExpression())); + } + newMath.setAllVariables(newVarArray); + } + + /** + * Insert the method's description here. + * Creation date: (5/25/01 11:34:08 AM) + * + * @return cbit.vcell.math.Variable[] + */ + public Function[] getFunctions(){ + + Vector functList = new Vector<>(); + + // + // get all variables from MathDescription, but replace MathOverrides + // + Variable[] variables = getVariables(); + for(Variable variable : variables){ + if(variable instanceof Function var){ + functList.addElement(var); + } + } + + return functList.toArray(Function[]::new); + } + + + public Constant getLocalConstant(Constant referenceConstant) throws ExpressionException{ + if(localVariableHash == null){ + localVariableHash = new HashMap(); + } + Variable var = localVariableHash.get(referenceConstant.getName()); + if(var instanceof Constant localConstant){ + + // + // make sure expression for localConstant is still up to date with MathOverrides table + // + Expression exp = simulation.getMathOverrides().getActualExpression(referenceConstant.getName(), index); + if(exp.compareEqual(localConstant.getExpression())){ + //localConstant.bind(this); // update bindings to latest mathOverrides + return localConstant; + } else { + // + // MathOverride's Expression changed for this Constant, remove and create new one + // + localVariableHash.remove(localConstant.getName()); + } + } else if(var != null){ + throw new RuntimeException("Variable " + var + " expected to be a Constant"); + } + // + // if local Constant not found, create new one, bind it to the Simulation (which ensures MathOverrides), and add to list + // + String name = referenceConstant.getName(); + Constant newLocalConstant = new Constant(name, simulation.getMathOverrides().getActualExpression(name, index)); + //newLocalConstant.bind(this); + localVariableHash.put(newLocalConstant.getName(), newLocalConstant); + return newLocalConstant; + } + + + private Function getLocalFunction(Function referenceFunction) throws ExpressionException{ + if(localVariableHash == null){ + localVariableHash = new HashMap(); + } + Variable var = localVariableHash.get(referenceFunction.getName()); + if(var instanceof Function){ + Function localFunction = (Function) var; + if(localFunction.compareEqual(referenceFunction)){ + //localFunction.bind(this); // update bindings to latest mathOverrides + return localFunction; + } + } else if(var != null){ + throw new RuntimeException("Variable " + var + " expected to be a Function"); + } + // + // if local Function not found, create new one, bind it to the Simulation (which ensures MathOverrides), and add to list + // + Function newLocalFunction = new Function(referenceFunction.getName(), referenceFunction.getExpression(), referenceFunction.getDomain()); + //newLocalFunction.bind(this); + localVariableHash.put(newLocalFunction.getName(), newLocalFunction); + + return newLocalFunction; + } + + + /** + * This method was created by a SmartGuide. + * + * @param exp cbit.vcell.parser.Expression + * @return java.util.Enumeration + */ + public Enumeration getRequiredVariables(Expression exp) throws MathException, ExpressionException{ + return MathUtilities.getRequiredVariables(exp, this); + } + + + /** + * Insert the method's description here. + * Creation date: (5/25/01 12:31:53 PM) + * + * @param variableName java.lang.String + * @return cbit.vcell.math.Variable + */ + public Variable getVariable(String variableName){ + return (Variable) getEntry(variableName); + } + + + /** + * Insert the method's description here. + * Creation date: (5/25/01 11:34:08 AM) + * + * @return cbit.vcell.math.Variable[] + */ + public Variable[] getVariables(){ + + Vector varList = new Vector(); + + // + // get all variables from MathDescription, but replace MathOverrides + // + Enumeration enum1 = simulation.getMathDescription().getVariables(); + while (enum1.hasMoreElements()) { + Variable mathDescriptionVar = enum1.nextElement(); + // + // replace all Constants with math overrides + // + if(mathDescriptionVar instanceof Constant){ + try { + Constant overriddenConstant = getLocalConstant((Constant) mathDescriptionVar); + varList.addElement(overriddenConstant); + } catch(ExpressionException e){ + throw new RuntimeException("local Constant " + mathDescriptionVar.getName() + " not found for Simulation", e); + } + // + // replace all Functions with local Functions that are bound to this Simulation + // + } else if(mathDescriptionVar instanceof Function){ + try { + Function overriddenFunction = getLocalFunction((Function) mathDescriptionVar); + varList.addElement(overriddenFunction); + } catch(ExpressionException e){ + throw new RuntimeException("local Function " + mathDescriptionVar.getName() + " not found for Simulation", e); + } + // + // pass all other Variables through + // + } else { + varList.addElement(mathDescriptionVar); + } + } + + return varList.toArray(Variable[]::new); + } + + + /** + * Insert the method's description here. + * Creation date: (6/20/01 12:35:46 PM) + */ + private void rebindAll(){ + // + // cleanup + // + if(localVariableHash != null){ + localVariableHash.clear(); + } + + // reload + getVariables(); + + // + // bind all Variables, since now all the variables are sorted alphabetically + // a constant might be function of other constants which have not bound yet. + // so we need to first bind all then evaluate. + // + if(localVariableHash != null){ + for(Variable variable : localVariableHash.values()){ + try { + variable.bind(this); // update bindings to latest mathOverrides + } catch(ExpressionBindingException e){ + lg.error(e); + } + } + } + } + + + /** + * This method was created in VisualAge. + * + * @param exp cbit.vcell.parser.Expression + * @return cbit.vcell.parser.Expression + * @throws java.lang.Exception The exception description. + */ + public Expression substituteFunctions(Expression exp) throws MathException, ExpressionException{ + return MathUtilities.substituteFunctions(exp, this); + } + + + public void getEntries(Map entryMap){ + simulation.getMathDescription().getEntries(entryMap); + entryMap.putAll(localVariableHash); + } + + + public void getLocalEntries(Map entryMap){ + getEntries(entryMap); + } + + + public SymbolTableEntry getLocalEntry(String identifier){ + return getEntry(identifier); + } + + + public NameScope getNameScope(){ + return nameScope; + } + + + public boolean hasTimeVaryingDiffusionOrAdvection() throws MathException, ExpressionException{ + for(Variable var : getVariables()){ + if(hasTimeVaryingDiffusionOrAdvection(var)){ + return true; + } + } + return false; + } + + public boolean hasTimeVaryingDiffusionOrAdvection(Variable variable) throws MathException, ExpressionException{ + + Enumeration enum1 = simulation.getMathDescription().getSubDomains(); + while (enum1.hasMoreElements()) { + SubDomain subDomain = enum1.nextElement(); + Equation equation = subDomain.getEquation(variable); + // + // get diffusion expressions, see if function of time or volume variables + // + if(equation instanceof PdeEquation){ + Vector spatialExpressionList = new Vector(); + spatialExpressionList.add(((PdeEquation) equation).getDiffusionExpression()); + if(((PdeEquation) equation).getVelocityX() != null){ + spatialExpressionList.add(((PdeEquation) equation).getVelocityX()); + } + if(((PdeEquation) equation).getVelocityY() != null){ + spatialExpressionList.add(((PdeEquation) equation).getVelocityY()); + } + if(((PdeEquation) equation).getVelocityZ() != null){ + spatialExpressionList.add(((PdeEquation) equation).getVelocityZ()); + } + for(int i = 0; i < spatialExpressionList.size(); i++){ + Expression spatialExp = spatialExpressionList.elementAt(i); + spatialExp = substituteFunctions(spatialExp); + String symbols[] = spatialExp.getSymbols(); + if(symbols != null){ + for(int j = 0; j < symbols.length; j++){ + SymbolTableEntry entry = spatialExp.getSymbolBinding(symbols[j]); + if(entry instanceof ReservedVariable){ + if(((ReservedVariable) entry).isTIME()){ + return true; + } + } + if(entry instanceof VolVariable){ + return true; + } + if(entry instanceof VolumeRegionVariable){ + return true; + } + if(entry instanceof MemVariable || entry instanceof MembraneRegionVariable){ + return true; + } + } + } + } + } + } + return false; + } + + /** + * Insert the method's description here. + * Creation date: (6/6/2001 10:57:51 AM) + * + * @param function cbit.vcell.math.Function + * @return boolean + */ + public static boolean isFunctionSaved(Function function){ + String name = function.getName(); + if(!name.startsWith("Kflux_") && +// !name.endsWith(MathMapping.MATH_FUNC_SUFFIX_SPECIES_INIT_CONCENTRATION_molecule_per_um2) && +// !name.endsWith(MathMapping.MATH_FUNC_SUFFIX_SPECIES_INIT_CONCENTRATION_uM) && + !(name.endsWith(DiffEquMathMapping.PARAMETER_MASS_CONSERVATION_SUFFIX) && name.startsWith(DiffEquMathMapping.PARAMETER_MASS_CONSERVATION_PREFIX)) && + !name.equals(Simulation.PSF_FUNCTION_NAME)){ + return true; + } else { + return false; + } + } + + public Vector createAnnotatedFunctionsList(MathDescription mathDescription) throws InconsistentDomainException{ + // Get the list of (volVariables) in the simulation. Needed to determine 'type' of functions + boolean bSpatial = getSimulation().isSpatial(); + String[] variableNames = null; + VariableType[] variableTypes = null; + + if(bSpatial){ + Variable[] allVariables = getVariables(); + Vector varVector = new Vector(); + for(int i = 0; i < allVariables.length; i++){ + if((allVariables[i] instanceof VolVariable) + || (allVariables[i] instanceof VolumeRegionVariable) + || (allVariables[i] instanceof MemVariable) + || (allVariables[i] instanceof MembraneRegionVariable) + || (allVariables[i] instanceof FilamentVariable) + || (allVariables[i] instanceof FilamentRegionVariable) + || (allVariables[i] instanceof PointVariable) + || (allVariables[i] instanceof ParticleVariable) + || (allVariables[i] instanceof InsideVariable) + || (allVariables[i] instanceof OutsideVariable)){ + varVector.addElement(allVariables[i]); + } else if(allVariables[i] instanceof Constant || + (allVariables[i] instanceof Function)){ + } else { + System.err.println("SimulationSymbolTable.createAnnotatedFunctionsList() found unexpected variable type " + allVariables[i].getClass().getSimpleName() + " in spatial simulation"); + } + } + variableNames = new String[varVector.size()]; + for(int i = 0; i < variableNames.length; i++){ + variableNames[i] = varVector.get(i).getName(); + } + + // Lookup table for variableType for each variable in 'variables' array. + variableTypes = new VariableType[variableNames.length]; + for(int i = 0; i < variableNames.length; i++){ + variableTypes[i] = VariableType.getVariableType(varVector.get(i)); + } + } + // + // Bind and substitute functions to simulation before storing them in the '.functions' file + // + Function[] functions = getFunctions(); + Vector annotatedFunctionVector = new Vector(); + for(int i = 0; i < functions.length; i++){ + if(isFunctionSaved(functions[i])){ + String errString = ""; + VariableType funcType = null; + try { + Expression substitutedExp = substituteFunctions(functions[i].getExpression()); + substitutedExp.bindExpression(this); + functions[i].setExpression(substitutedExp.flatten()); + } catch(MathException | ExpressionException e){ + lg.error(e); + errString = errString + ", " + e.getMessage(); + // throw new RuntimeException(e.getMessage()); + } + + // + // get function's data type from the types of it's identifiers + // + funcType = bSpatial ? getFunctionVariableType(functions[i], mathDescription, variableNames, variableTypes, bSpatial) : VariableType.NONSPATIAL; + + AnnotatedFunction annotatedFunc = new AnnotatedFunction(functions[i].getName(), functions[i].getExpression(), functions[i].getDomain(), errString, funcType, FunctionCategory.PREDEFINED); + annotatedFunctionVector.addElement(annotatedFunc); + } + } + + + return annotatedFunctionVector; + } + + /** + * Insert the method's description here. + * Creation date: (2/19/2004 11:17:15 AM) + * + * @param function cbit.vcell.math.Function + * @param variableNames java.lang.String[] + * @param variableTypes cbit.vcell.simdata.VariableType[] + * @return cbit.vcell.simdata.VariableType + */ + public static VariableType getFunctionVariableType(Function function, MathDescription mathDescription, + String[] variableNames, VariableType[] variableTypes, boolean isSpatial) throws InconsistentDomainException{ + if(!isSpatial){ + return VariableType.NONSPATIAL; + } + VariableType domainFuncType = null; + // initial guess, restrict variable type to be consistent with domain. + if(function.getDomain() != null){ + String domainName = function.getDomain().getName(); + if(mathDescription != null){ + SubDomain subdomain = mathDescription.getSubDomain(domainName); + if(subdomain instanceof MembraneSubDomain){ + domainFuncType = VariableType.MEMBRANE_REGION; + } else { + domainFuncType = VariableType.VOLUME_REGION; + } + } + } + + Expression exp = function.getExpression(); + String symbols[] = exp.getSymbols(); + ArrayList varTypeList = new ArrayList(); + boolean bExplicitFunctionOfSpace = false; + if(symbols != null){ + for(int j = 0; j < symbols.length; j++){ + if(symbols[j].equals(ReservedVariable.X.getName()) || + symbols[j].equals(ReservedVariable.Y.getName()) || + symbols[j].equals(ReservedVariable.Z.getName())){ + bExplicitFunctionOfSpace = true; + continue; + } + for(int k = 0; k < variableNames.length; k++){ + if(symbols[j].equals(variableNames[k])){ + varTypeList.add(variableTypes[k]); + break; + } else if(symbols[j].equals(variableNames[k] + InsideVariable.INSIDE_VARIABLE_SUFFIX) + || symbols[j].equals(variableNames[k] + OutsideVariable.OUTSIDE_VARIABLE_SUFFIX)){ + if(variableTypes[k].equals(VariableType.VOLUME)){ + varTypeList.add(VariableType.MEMBRANE); + } else if(variableTypes[k].equals(VariableType.VOLUME_REGION)){ + varTypeList.add(VariableType.MEMBRANE_REGION); + } + break; + } + } + } + } + + // Size Functions + Set sizeFunctionInvocationSet = SolverUtilities.getSizeFunctionInvocations(function.getExpression()); + for(FunctionInvocation fi : sizeFunctionInvocationSet){ + String functionName = fi.getFunctionName(); + if(functionName.equals(MathFunctionDefinitions.Function_regionArea_current.getFunctionName())){ + varTypeList.add(VariableType.MEMBRANE_REGION); + } else if(functionName.equals(MathFunctionDefinitions.Function_regionVolume_current.getFunctionName())){ + varTypeList.add(VariableType.VOLUME_REGION); + } + } + + // Membrane Normal Functions + FunctionInvocation[] functionInvocations = function.getExpression().getFunctionInvocations(null); + for(FunctionInvocation fi : functionInvocations){ + String functionName = fi.getFunctionName(); + if(functionName.equals(MathFunctionDefinitions.Function_normalX.getFunctionName()) + || functionName.equals(MathFunctionDefinitions.Function_normalY.getFunctionName())){ + varTypeList.add(VariableType.MEMBRANE); + } + } + + FieldFunctionArguments[] fieldFuncArgs = FieldUtilities.getFieldFunctionArguments(function.getExpression()); + if(fieldFuncArgs != null && fieldFuncArgs.length > 0){ + varTypeList.add(fieldFuncArgs[0].getVariableType()); + } + + VariableType funcType = domainFuncType; + for(VariableType vt : varTypeList){ + if(funcType == null){ + funcType = vt; + } else { + // + // example: if VOLUME_REGION and VOLUME data are used in same function, + // then function must be evaluated at each volume index (hence VOLUME wins). + // + if(vt.isExpansionOf(funcType)){ + funcType = vt; + } else if(vt.equals(VariableType.VOLUME)){ + if(funcType.equals(VariableType.MEMBRANE_REGION)){ + funcType = VariableType.MEMBRANE; + } + } else if(vt.equals(VariableType.VOLUME_REGION)){ + + } else if(vt.equals(VariableType.MEMBRANE)){ + if(domainFuncType != null && domainFuncType.getVariableDomain().equals(VariableDomain.VARIABLEDOMAIN_VOLUME)){ + throw new InconsistentDomainException("Function '" + function.getName() + "' defined on a volume subdomain '" + function.getDomain().getName() + + "' references a variable or a function defined on a membrane subdomain"); + } + } else if(vt.equals(VariableType.MEMBRANE_REGION)){ + if(funcType.equals(VariableType.VOLUME)){ + if(domainFuncType != null && domainFuncType.getVariableDomain().equals(VariableDomain.VARIABLEDOMAIN_VOLUME)){ + throw new InconsistentDomainException("Function '" + function.getName() + "' defined on '" + function.getDomain().getName() + + "' references a size function defined on a membrane"); + } + funcType = VariableType.MEMBRANE; + } else if(funcType.equals(VariableType.VOLUME_REGION)){ + if(domainFuncType != null && domainFuncType.getVariableDomain().equals(VariableDomain.VARIABLEDOMAIN_VOLUME)){ + throw new InconsistentDomainException("Function '" + function.getName() + "' defined on '" + function.getDomain().getName() + + "' references a size function defined on a membrane"); + } + funcType = VariableType.MEMBRANE_REGION; + } + } else if(vt.incompatibleWith(funcType)){ + throw new InconsistentDomainException("Function domains conflict between variable domains '" + vt.getDefaultLabel() + "' and '" + funcType.getDefaultLabel() + " for function " + function.getName()); + } + } + } + + // + // if determined to be a volume region or membrane region function, + // then if it is an explicit function of space, promote type to corresponding non-region type (e.g. volRegion --> volume) + // + if(funcType != null && bExplicitFunctionOfSpace){ + if(funcType.equals(VariableType.MEMBRANE_REGION)){ + funcType = VariableType.MEMBRANE; + } else if(funcType.equals(VariableType.VOLUME_REGION)){ + funcType = VariableType.VOLUME; + } else if(funcType.equals(VariableType.CONTOUR_REGION)){ + funcType = VariableType.CONTOUR; + } + } + + if(funcType == null){ + if(variableTypes != null && variableTypes.length > 0){ + Set variableTypeSet = new LinkedHashSet<>(); + for(VariableType vt : variableTypes){ + variableTypeSet.add(vt); + } + if(variableTypeSet.size() != 1){ + return VariableType.VOLUME; + } else { + return variableTypeSet.iterator().next(); + } + } + return VariableType.VOLUME; // no knowledge from expression, default variable type + } + + return funcType; + } + + public static MathSymbolTableFactory createMathSymbolTableFactory(){ + return new MathSymbolTableFactory() { + public MathSymbolTable createMathSymbolTable(MathDescription newMath){ + return new SimulationSymbolTable(new Simulation(newMath, null), 0); + } + }; + } +} diff --git a/vcell-core/src/main/java/cbit/vcell/solver/SimulationWarning.java b/vcell-core/src/main/java/cbit/vcell/solver/simulation/SimulationWarning.java similarity index 97% rename from vcell-core/src/main/java/cbit/vcell/solver/SimulationWarning.java rename to vcell-core/src/main/java/cbit/vcell/solver/simulation/SimulationWarning.java index 3c2c38db75..ec920b0894 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/SimulationWarning.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/simulation/SimulationWarning.java @@ -1,201 +1,205 @@ -package cbit.vcell.solver; - -import java.text.DecimalFormat; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.IdentityHashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Objects; - -import org.apache.commons.lang3.mutable.MutableDouble; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.vcell.util.Issue; -import org.vcell.util.Issue.IssueCategory; -import org.vcell.util.Issue.Severity; -import org.vcell.util.IssueContext; - -import cbit.vcell.geometry.Geometry; -import cbit.vcell.math.MathDescription; -import cbit.vcell.math.MathUtilities; -import cbit.vcell.math.MembraneSubDomain; -import cbit.vcell.math.ParticleProperties; -import cbit.vcell.math.SubDomain; -import cbit.vcell.parser.Expression; -import cbit.vcell.parser.ExpressionException; - -/** - * Implementation of simulation warnings - */ -class SimulationWarning { - - /** - * variable names and their diffusion values - */ - private static class DiffusionValue { - final String name; - final double value; - - DiffusionValue(String name, double value) { - this.name = name; - this.value = value; - } - - @Override - public String toString() { - return "DiffusionValue [name=" + name + ", value=" + value + "]"; - } - } - - static Logger lg = LogManager.getLogger(SimulationWarning.class); - - public static void gatherIssues(Simulation simulation, IssueContext issueContext, List issueList){ - if (simulation.getSolverTaskDescription().getSolverDescription() == SolverDescription.Smoldyn){ - try { - SolverTaskDescription std = simulation.getSolverTaskDescription(); - TimeStep ts = std.getTimeStep(); - double timeStep = ts.getDefaultTimeStep(); - Map> diffusionValuesMap = analyzeDiffusion(simulation, timeStep, issueContext, issueList); - analyzeArea(simulation, timeStep, diffusionValuesMap, issueContext, issueList); - } catch (ExpressionException e) { - lg.error(e); - } - } - } - - /** - * Empirically determined adjustment factor to make warning based on mesh sizing more conservative than that determined - * by actual tesellation - */ - private static final double PRECHECK_LIMIT_ADJUST = 0.6; - - /** - * make sure diffusion expressions are constants, store for later use - * @throws ExpressionException - */ - private static Map> analyzeDiffusion(Simulation simulation, double timeStep, IssueContext issueContext, List issueList) throws ExpressionException { - - Map> diffusionValuesMap = new IdentityHashMap<>(); - - diffusionValuesMap.clear(); - MutableDouble value = new MutableDouble(); - MathDescription cm = simulation.getMathDescription(); - Objects.requireNonNull(cm); - MathDescription localMath = new MathDescription(cm); - SimulationSymbolTable symTable = new SimulationSymbolTable(simulation, 0); - Map> dvMap = new HashMap<>(); - double maxDiffValue = Double.MIN_VALUE; - List diffusionList = new ArrayList<>(); - for (SubDomain sd : localMath.getSubDomainCollection()) { - final boolean isMembrane = sd instanceof MembraneSubDomain; - diffusionList.clear(); - for (ParticleProperties pp : sd.getParticleProperties()) { - String name = pp.getVariable().getName(); - Expression diffExp = pp.getDiffusion(); - Expression flattened = MathUtilities.substituteFunctions(diffExp, symTable).flatten(); - if (isConstant(flattened, value)) { - if (isMembrane) { - DiffusionValue dv = new DiffusionValue(name, value.doubleValue()); - maxDiffValue = Math.max(maxDiffValue, dv.value); - diffusionList.add(dv); - } - } else { - String s = "Smoldyn only supports constant diffusion, " + name + " is variable"; - Issue i = new Issue(simulation, issueContext, IssueCategory.SMOLYDN_DIFFUSION, s,s,Severity.ERROR); - issueList.add(i); - } - } - if (isMembrane && !diffusionList.isEmpty()) { - dvMap.put((MembraneSubDomain) sd, diffusionList); - } - } - diffusionValuesMap.putAll(dvMap); - MeshSpecification ms = simulation.getMeshSpecification(); - Geometry g = ms.getGeometry(); - int dim = g.getDimension(); - double minDelta = Double.MAX_VALUE; - switch (dim) { - case 3: - minDelta = Math.min(minDelta, ms.getDz(true)); - // fall-through - case 2: - minDelta = Math.min(minDelta, ms.getDy(true)); - // fall-through - case 1: - minDelta = Math.min(minDelta, ms.getDx(true)); - break; - default: - throw new RuntimeException("Invalid dimension " + dim + " for smoldyn solver"); - } - double minArea = minDelta * minDelta / 2; - double limit = PRECHECK_LIMIT_ADJUST * minArea / maxDiffValue; - boolean warn = (timeStep > limit); - if (lg.isDebugEnabled()) { - lg.debug("Min delta " + minDelta + ", min area " + minArea + " time limit " + limit + " timeStep " + timeStep + " -> warn = " + warn); - } - if (warn) { - String s = "Time step " + timeStep + " may be too large, performing further analysis ..."; - Issue i = new Issue(simulation, issueContext, IssueCategory.SMOLYDN_DIFFUSION, s,s,Severity.WARNING); - issueList.add(i); - } - lg.debug("end of diffusion analysis"); - return diffusionValuesMap; - } - - private static void analyzeArea(Simulation simulation, double timeStep, Map> diffusionValuesMap, IssueContext issueContext, List issueList) { - double dx = simulation.getMeshSpecification().getDx(true); - double dy = simulation.getMeshSpecification().getDy(true); - double dz = simulation.getMeshSpecification().getDz(true); - int dim = simulation.getMathDescription().getGeometry().getDimension(); - if (dim<3){ - throw new RuntimeException("suggested timestep analysis for smoldyn not implemented for "+dim+"D simulations"); - } - double smallestQuadArea = Math.min(Math.min(dx*dy, dy*dz), dx*dz); - double averageTriangleSize = smallestQuadArea/4; // 1/2 for quad to triangle, 1/2 for smoother surface - for (Entry> entry : diffusionValuesMap.entrySet()) { - MembraneSubDomain msd = entry.getKey(); - for (DiffusionValue dv : entry.getValue()) { - double ad = averageTriangleSize / dv.value; - boolean warn = (timeStep >= ad); - if (lg.isDebugEnabled()) { - lg.debug("average area " + averageTriangleSize + " diffusion " + dv.value + " time step limit " + ad + "timeStep " + timeStep + " -> warn " + warn); - } - if (warn) { - DecimalFormat f = new DecimalFormat("0.##E0"); - String limit = f.format(ad); - String m = "Solver time step " + timeStep - + " may yield inaccurate results for given mesh size and diffusion coefficient of species " - + dv.name + " on membrane " + msd.getName() - + "; it is recommended that the time step not exceed " + limit; - Issue i = new Issue(simulation, issueContext, IssueCategory.SMOLYDN_DIFFUSION, m,m,Severity.WARNING); - issueList.add(i); - if (lg.isDebugEnabled()) { - lg.debug("Warning " + m); - } - } - } - } - } - - /** - * determine if constant - * - * @param e - * non null - * @param value - * out parameter - * @return true if constant and value via parameter - */ - private static boolean isConstant(Expression e, MutableDouble value) { - try { - double d = e.evaluateConstant(); - value.setValue(d); - } catch (Exception exc) { - return false; - } - return true; - } - -} +package cbit.vcell.solver.simulation; + +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.IdentityHashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; + +import cbit.vcell.solver.MeshSpecification; +import cbit.vcell.solver.SolverDescription; +import cbit.vcell.solver.SolverTaskDescription; +import cbit.vcell.solver.TimeStep; +import org.apache.commons.lang3.mutable.MutableDouble; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.vcell.util.Issue; +import org.vcell.util.Issue.IssueCategory; +import org.vcell.util.Issue.Severity; +import org.vcell.util.IssueContext; + +import cbit.vcell.geometry.Geometry; +import cbit.vcell.math.MathDescription; +import cbit.vcell.math.MathUtilities; +import cbit.vcell.math.MembraneSubDomain; +import cbit.vcell.math.ParticleProperties; +import cbit.vcell.math.SubDomain; +import cbit.vcell.parser.Expression; +import cbit.vcell.parser.ExpressionException; + +/** + * Implementation of simulation warnings + */ +class SimulationWarning { + + /** + * variable names and their diffusion values + */ + private static class DiffusionValue { + final String name; + final double value; + + DiffusionValue(String name, double value) { + this.name = name; + this.value = value; + } + + @Override + public String toString() { + return "DiffusionValue [name=" + name + ", value=" + value + "]"; + } + } + + static Logger lg = LogManager.getLogger(SimulationWarning.class); + + public static void gatherIssues(Simulation simulation, IssueContext issueContext, List issueList){ + if (simulation.getSolverTaskDescription().getSolverDescription() == SolverDescription.Smoldyn){ + try { + SolverTaskDescription std = simulation.getSolverTaskDescription(); + TimeStep ts = std.getTimeStep(); + double timeStep = ts.getDefaultTimeStep(); + Map> diffusionValuesMap = analyzeDiffusion(simulation, timeStep, issueContext, issueList); + analyzeArea(simulation, timeStep, diffusionValuesMap, issueContext, issueList); + } catch (ExpressionException e) { + lg.error(e); + } + } + } + + /** + * Empirically determined adjustment factor to make warning based on mesh sizing more conservative than that determined + * by actual tesellation + */ + private static final double PRECHECK_LIMIT_ADJUST = 0.6; + + /** + * make sure diffusion expressions are constants, store for later use + * @throws ExpressionException + */ + private static Map> analyzeDiffusion(Simulation simulation, double timeStep, IssueContext issueContext, List issueList) throws ExpressionException { + + Map> diffusionValuesMap = new IdentityHashMap<>(); + + diffusionValuesMap.clear(); + MutableDouble value = new MutableDouble(); + MathDescription cm = simulation.getMathDescription(); + Objects.requireNonNull(cm); + MathDescription localMath = new MathDescription(cm); + SimulationSymbolTable symTable = new SimulationSymbolTable(simulation, 0); + Map> dvMap = new HashMap<>(); + double maxDiffValue = Double.MIN_VALUE; + List diffusionList = new ArrayList<>(); + for (SubDomain sd : localMath.getSubDomainCollection()) { + final boolean isMembrane = sd instanceof MembraneSubDomain; + diffusionList.clear(); + for (ParticleProperties pp : sd.getParticleProperties()) { + String name = pp.getVariable().getName(); + Expression diffExp = pp.getDiffusion(); + Expression flattened = MathUtilities.substituteFunctions(diffExp, symTable).flatten(); + if (isConstant(flattened, value)) { + if (isMembrane) { + DiffusionValue dv = new DiffusionValue(name, value.doubleValue()); + maxDiffValue = Math.max(maxDiffValue, dv.value); + diffusionList.add(dv); + } + } else { + String s = "Smoldyn only supports constant diffusion, " + name + " is variable"; + Issue i = new Issue(simulation, issueContext, IssueCategory.SMOLYDN_DIFFUSION, s,s,Severity.ERROR); + issueList.add(i); + } + } + if (isMembrane && !diffusionList.isEmpty()) { + dvMap.put((MembraneSubDomain) sd, diffusionList); + } + } + diffusionValuesMap.putAll(dvMap); + MeshSpecification ms = simulation.getMeshSpecification(); + Geometry g = ms.getGeometry(); + int dim = g.getDimension(); + double minDelta = Double.MAX_VALUE; + switch (dim) { + case 3: + minDelta = Math.min(minDelta, ms.getDz(true)); + // fall-through + case 2: + minDelta = Math.min(minDelta, ms.getDy(true)); + // fall-through + case 1: + minDelta = Math.min(minDelta, ms.getDx(true)); + break; + default: + throw new RuntimeException("Invalid dimension " + dim + " for smoldyn solver"); + } + double minArea = minDelta * minDelta / 2; + double limit = PRECHECK_LIMIT_ADJUST * minArea / maxDiffValue; + boolean warn = (timeStep > limit); + if (lg.isDebugEnabled()) { + lg.debug("Min delta " + minDelta + ", min area " + minArea + " time limit " + limit + " timeStep " + timeStep + " -> warn = " + warn); + } + if (warn) { + String s = "Time step " + timeStep + " may be too large, performing further analysis ..."; + Issue i = new Issue(simulation, issueContext, IssueCategory.SMOLYDN_DIFFUSION, s,s,Severity.WARNING); + issueList.add(i); + } + lg.debug("end of diffusion analysis"); + return diffusionValuesMap; + } + + private static void analyzeArea(Simulation simulation, double timeStep, Map> diffusionValuesMap, IssueContext issueContext, List issueList) { + double dx = simulation.getMeshSpecification().getDx(true); + double dy = simulation.getMeshSpecification().getDy(true); + double dz = simulation.getMeshSpecification().getDz(true); + int dim = simulation.getMathDescription().getGeometry().getDimension(); + if (dim<3){ + throw new RuntimeException("suggested timestep analysis for smoldyn not implemented for "+dim+"D simulations"); + } + double smallestQuadArea = Math.min(Math.min(dx*dy, dy*dz), dx*dz); + double averageTriangleSize = smallestQuadArea/4; // 1/2 for quad to triangle, 1/2 for smoother surface + for (Entry> entry : diffusionValuesMap.entrySet()) { + MembraneSubDomain msd = entry.getKey(); + for (DiffusionValue dv : entry.getValue()) { + double ad = averageTriangleSize / dv.value; + boolean warn = (timeStep >= ad); + if (lg.isDebugEnabled()) { + lg.debug("average area " + averageTriangleSize + " diffusion " + dv.value + " time step limit " + ad + "timeStep " + timeStep + " -> warn " + warn); + } + if (warn) { + DecimalFormat f = new DecimalFormat("0.##E0"); + String limit = f.format(ad); + String m = "Solver time step " + timeStep + + " may yield inaccurate results for given mesh size and diffusion coefficient of species " + + dv.name + " on membrane " + msd.getName() + + "; it is recommended that the time step not exceed " + limit; + Issue i = new Issue(simulation, issueContext, IssueCategory.SMOLYDN_DIFFUSION, m,m,Severity.WARNING); + issueList.add(i); + if (lg.isDebugEnabled()) { + lg.debug("Warning " + m); + } + } + } + } + } + + /** + * determine if constant + * + * @param e + * non null + * @param value + * out parameter + * @return true if constant and value via parameter + */ + private static boolean isConstant(Expression e, MutableDouble value) { + try { + double d = e.evaluateConstant(); + value.setValue(d); + } catch (Exception exc) { + return false; + } + return true; + } + +} diff --git a/vcell-core/src/main/java/cbit/vcell/solver/stoch/GibsonSolver.java b/vcell-core/src/main/java/cbit/vcell/solver/stoch/GibsonSolver.java index 2bca58de24..0dc74a707f 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/stoch/GibsonSolver.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/stoch/GibsonSolver.java @@ -24,10 +24,10 @@ import cbit.vcell.math.FunctionColumnDescription; import cbit.vcell.math.MathException; import cbit.vcell.math.ODESolverResultSetColumnDescription; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.parser.Expression; import cbit.vcell.parser.ExpressionException; -import cbit.vcell.solver.SimulationSymbolTable; +import cbit.vcell.solver.simulation.SimulationSymbolTable; import cbit.vcell.solver.SolverDescription; import cbit.vcell.solver.SolverException; import cbit.vcell.solver.SolverUtilities; @@ -48,7 +48,7 @@ public class GibsonSolver extends SimpleCompiledSolver { private int saveToFileInterval = 6; // seconds private long lastSavedMS = 0; // milliseconds since last save -public GibsonSolver(SimulationTask simTask, java.io.File directory, boolean bMessaging) throws SolverException { +public GibsonSolver(StandardSimulationTask simTask, java.io.File directory, boolean bMessaging) throws SolverException { super(simTask, directory, bMessaging); } diff --git a/vcell-core/src/main/java/cbit/vcell/solver/stoch/HybridSolver.java b/vcell-core/src/main/java/cbit/vcell/solver/stoch/HybridSolver.java index 7206f26828..6a98e364ee 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/stoch/HybridSolver.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/stoch/HybridSolver.java @@ -24,12 +24,12 @@ import cbit.vcell.math.FunctionColumnDescription; import cbit.vcell.math.MathException; import cbit.vcell.math.ODESolverResultSetColumnDescription; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.parser.Expression; import cbit.vcell.parser.ExpressionException; import cbit.vcell.solver.NonspatialStochHybridOptions; import cbit.vcell.solver.NonspatialStochSimOptions; -import cbit.vcell.solver.SimulationSymbolTable; +import cbit.vcell.solver.simulation.SimulationSymbolTable; import cbit.vcell.solver.SolverDescription; import cbit.vcell.solver.SolverException; import cbit.vcell.solver.SolverTaskDescription; @@ -63,7 +63,7 @@ public class HybridSolver extends SimpleCompiledSolver { private int integratorType = EMIntegrator; -public HybridSolver(SimulationTask simTask, java.io.File directory, int type, boolean b_Msging) throws cbit.vcell.solver.SolverException { +public HybridSolver(StandardSimulationTask simTask, java.io.File directory, int type, boolean b_Msging) throws cbit.vcell.solver.SolverException { super(simTask, directory, b_Msging); integratorType = type; } diff --git a/vcell-core/src/main/java/cbit/vcell/solver/stoch/NetCDFWriter.java b/vcell-core/src/main/java/cbit/vcell/solver/stoch/NetCDFWriter.java index 6765a15cbc..5aac849775 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/stoch/NetCDFWriter.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/stoch/NetCDFWriter.java @@ -31,13 +31,13 @@ import cbit.vcell.math.Variable; import cbit.vcell.message.VCellQueue; import cbit.vcell.message.VCellTopic; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.parser.Expression; import cbit.vcell.parser.ExpressionException; import cbit.vcell.resource.PropertyLoader; import cbit.vcell.solver.NonspatialStochSimOptions; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationSymbolTable; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationSymbolTable; import cbit.vcell.solver.SolverTaskDescription; import cbit.vcell.solver.TimeBounds; import cbit.vcell.solver.UniformOutputTimeSpec; @@ -64,14 +64,14 @@ public class NetCDFWriter { private final static Logger lg = LogManager.getLogger(NetCDFWriter.class); private String filename = null; - private SimulationTask simTask = null; + private StandardSimulationTask simTask = null; // to store variables and their orders in the reactions. It is set to global in this // class, since it is useful in a few functions and we don't want to calculate it // again and again. it is calculated in function getReactionRateLaws. private Hashtable[] varInProbOrderHash = null; private boolean bMessaging; - public NetCDFWriter(SimulationTask simTask, String fn, boolean argMessaging) + public NetCDFWriter(StandardSimulationTask simTask, String fn, boolean argMessaging) { this.simTask = simTask; filename = fn; diff --git a/vcell-core/src/main/java/cbit/vcell/solver/stoch/StochFileWriter.java b/vcell-core/src/main/java/cbit/vcell/solver/stoch/StochFileWriter.java index 80c9e477f6..967b4a5d54 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/stoch/StochFileWriter.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/stoch/StochFileWriter.java @@ -24,14 +24,14 @@ import cbit.vcell.math.SubDomain; import cbit.vcell.math.VarIniCondition; import cbit.vcell.math.VarIniCount; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.parser.Expression; import cbit.vcell.parser.ExpressionException; import cbit.vcell.solver.DefaultOutputTimeSpec; import cbit.vcell.solver.ErrorTolerance; import cbit.vcell.solver.NonspatialStochSimOptions; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationSymbolTable; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationSymbolTable; import cbit.vcell.solver.SolverDescription; import cbit.vcell.solver.UniformOutputTimeSpec; import cbit.vcell.solver.server.SolverFileWriter; @@ -52,13 +52,13 @@ public class StochFileWriter extends SolverFileWriter /** * StochFileWriter constructor comment. */ -public StochFileWriter(PrintWriter pw, SimulationTask simTask, boolean bMessaging) +public StochFileWriter(PrintWriter pw, StandardSimulationTask simTask, boolean bMessaging) { super(pw, simTask, bMessaging); isMultiTrialNonHisto = StochFileWriter.isStochMultiTrial(simTask); } -public static boolean isStochMultiTrial(SimulationTask simTask) { +public static boolean isStochMultiTrial(StandardSimulationTask simTask) { return simTask.getSimulationJob().getSimulation().getSolverTaskDescription().getSolverDescription() == SolverDescription.StochGibson && simTask.getSimulationJob().getSimulation().getSolverTaskDescription().getStochOpt() != null && !simTask.getSimulationJob().getSimulation().getSolverTaskDescription().getStochOpt().isHistogram() && diff --git a/vcell-core/src/main/java/cbit/vcell/solver/test/HybridSolverTester.java b/vcell-core/src/main/java/cbit/vcell/solver/test/HybridSolverTester.java index abf3dcaa9c..f4000d2227 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/test/HybridSolverTester.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/test/HybridSolverTester.java @@ -37,7 +37,7 @@ import cbit.rmi.event.MessageEvent; import cbit.vcell.mathmodel.MathModel; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.mongodb.VCMongoMessage; import cbit.vcell.server.SimulationJobStatusPersistent; import cbit.vcell.server.SimulationStatus; @@ -51,8 +51,8 @@ import cbit.vcell.simdata.SimDataBlock; import cbit.vcell.simdata.SimDataConstants; import cbit.vcell.simdata.SimulationData; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationJob; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationJob; import cbit.vcell.solver.VCSimulationDataIdentifier; import cbit.vcell.solver.VCSimulationIdentifier; import cbit.vcell.solver.server.SolverStatus; @@ -113,7 +113,7 @@ public void runHybridTest(String site){ sim.getSolverTaskDescription().getSmoldynSimulationOptions().setRandomSeed(new Integer(startTrialNo + i)); //create sim job int jobIndex = startTrialNo + i; - SimulationTask simTask = new SimulationTask(new SimulationJob(sim,jobIndex, null),0); + StandardSimulationTask simTask = new StandardSimulationTask(new SimulationJob(sim,jobIndex, null),0); /* * When you want to run the multiple trials on local uncomment the line below. */ diff --git a/vcell-core/src/main/java/cbit/vcell/solver/test/MathTestingUtilities.java b/vcell-core/src/main/java/cbit/vcell/solver/test/MathTestingUtilities.java index aa146ba86e..5303b6dde5 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/test/MathTestingUtilities.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/test/MathTestingUtilities.java @@ -14,7 +14,7 @@ import java.util.Enumeration; import java.util.Vector; -import cbit.vcell.solver.SimulationOwner; +import cbit.vcell.solver.simulation.SimulationOwner; import org.vcell.util.*; import org.vcell.util.document.VCDocument; @@ -68,8 +68,8 @@ import cbit.vcell.simdata.PDEDataManager; import cbit.vcell.simdata.SimDataBlock; import cbit.vcell.simdata.SimDataConstants; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationSymbolTable; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationSymbolTable; import cbit.vcell.solver.ode.ODESolverResultSet; import cbit.vcell.solver.ode.SensVariable; import cbit.vcell.solvers.CartesianMesh; diff --git a/vcell-core/src/main/java/cbit/vcell/solvers/AbstractCompiledSolver.java b/vcell-core/src/main/java/cbit/vcell/solvers/AbstractCompiledSolver.java index 3db8cbd954..4ab6590eac 100644 --- a/vcell-core/src/main/java/cbit/vcell/solvers/AbstractCompiledSolver.java +++ b/vcell-core/src/main/java/cbit/vcell/solvers/AbstractCompiledSolver.java @@ -10,30 +10,26 @@ package cbit.vcell.solvers; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.resource.OperatingSystemInfo; import cbit.vcell.resource.ResourceUtil; import cbit.vcell.solver.*; import cbit.vcell.solver.server.SimulationMessage; import cbit.vcell.solver.server.SolverStatus; +import cbit.vcell.solver.simulation.Simulation; import org.vcell.util.document.User; -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; +import java.io.*; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Vector; +import java.util.*; +import java.util.stream.Collectors; +import java.util.stream.Stream; /** * Insert the type's description here. * Creation date: (6/26/2001 3:18:18 PM) - * - * @author: Ion Moraru */ public abstract class AbstractCompiledSolver extends AbstractSolver implements java.beans.PropertyChangeListener { /** @@ -46,14 +42,14 @@ public abstract class AbstractCompiledSolver extends AbstractSolver implements j protected final static String DATA_PREFIX = "data:"; protected final static String PROGRESS_PREFIX = "progress:"; protected final static String SEPARATOR = ":"; - protected boolean bMessaging = true; + protected boolean bMessaging; /** * AbstractPDESolver constructor comment. */ - public AbstractCompiledSolver(SimulationTask simTask, File directory, boolean bMsging) throws SolverException { + public AbstractCompiledSolver(StandardSimulationTask simTask, File directory, boolean bMessaging) throws SolverException { super(simTask, directory); - bMessaging = bMsging; + this.bMessaging = bMessaging; setCurrentTime(simTask.getSimulationJob().getSimulation().getSolverTaskDescription().getTimeBounds().getStartingTime()); } @@ -113,13 +109,12 @@ public double getProgress() { public void propertyChange(java.beans.PropertyChangeEvent event) { if (event.getSource() == getMathExecutable() && event.getPropertyName().equals("applicationMessage")) { String messageString = (String) event.getNewValue(); - if (messageString == null || messageString.length() == 0) { + if (messageString == null || messageString.isEmpty()) { return; } ApplicationMessage appMessage = getApplicationMessage(messageString); if (appMessage == null) { if (lg.isWarnEnabled()) lg.warn("AbstractCompiledSolver: Unexpected Message '" + messageString + "'"); - return; } else { switch (appMessage.getMessageType()) { case ApplicationMessage.PROGRESS_MESSAGE: { @@ -196,96 +191,144 @@ public void runSolver() { } private void checkLinuxSharedLibs() throws IOException, InterruptedException { - if (OperatingSystemInfo.getInstance().isLinux()) { - File localSimDir = ResourceUtil.getLocalSimDir(User.tempUser.getName()); - File mySolverLinkDir = new File(localSimDir, simTask.getSimKey().toString() + ResourceUtil.LOCAL_SOLVER_LIB_LINK_SUFFIX); - if (mySolverLinkDir.exists()) { - File[] temp = mySolverLinkDir.listFiles(); - for (int i = 0; i < temp.length; i++) { - temp[i].delete(); - } - } else { - mySolverLinkDir.mkdir(); - } - SolverDescription mySolverDescription = getSimulationJob().getSimulation().getSolverTaskDescription().getSolverDescription(); - File localSolverPath = SolverUtilities.getExes(mySolverDescription)[0]; - Path linkSolver = createSymbolicLink(mySolverLinkDir, localSolverPath.getName(), localSolverPath); - final String LD_LIB_PATH = "LD_LIBRARY_PATH"; - String newLD_LIB_PATH = mySolverLinkDir.getAbsolutePath(); - File solversDir = ResourceUtil.getLocalSolversDirectory(); -// System.out.println("-----reading solverdir libs "+solversDir.getAbsolutePath()); - ArrayList tempAL = new ArrayList(); - File[] temp = solversDir.listFiles(); - for (int i = 0; i < temp.length; i++) { - if (temp[i].getName().startsWith("lib") && temp[i].isFile() && temp[i].length() != 0 && !Files.isSymbolicLink(temp[i].toPath())) { - tempAL.add(temp[i]); -// System.out.println(temp[i].getName()); - } - } - File[] libzipSolverFiles = (File[]) tempAL.toArray(new File[0]); - ProcessBuilder pb = new ProcessBuilder("ldd", linkSolver.toString()); - pb.redirectErrorStream(true); - Process p = pb.start(); - int ioByte = -1; - StringBuffer sb = new StringBuffer(); - while ((ioByte = p.getInputStream().read()) != -1) { - sb.append((char) ioByte); - } - p.waitFor(); -// System.out.println("-----ldd output:\n"+sb.toString()); - - //Try to save output to file for cli without interfering with further processing - File stdOutFile = new File(String.valueOf(Paths.get(System.getProperty("user.dir"))), "stdOut.txt"); - try (BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(stdOutFile))){ - bos.write(sb.toString().getBytes()); - }catch(Exception e) { - lg.error(e.getMessage(), e); + if (OperatingSystemInfo.getInstance().isMac()) { + lg.trace(String.format("Setting env var `%s` to: \"%s\"", "HDF5_DISABLE_VERSION_CHECK", "1")); + getMathExecutable().addEnvironmentVariable("HDF5_DISABLE_VERSION_CHECK", "1"); + return; + } + if (!OperatingSystemInfo.getInstance().isLinux()) return; + + // Delete remnants of last run (or create a fresh link directory) + File localSimDir = ResourceUtil.getLocalSimDir(User.tempUser.getName()); + File mySolverLinkDir = new File(localSimDir, simTask.getSimKey().toString() + ResourceUtil.LOCAL_SOLVER_LIB_LINK_SUFFIX); + if (!mySolverLinkDir.exists()) { + boolean ignored = mySolverLinkDir.mkdir(); + } + File[] temp = mySolverLinkDir.listFiles(); + if (temp == null) throw new NullPointerException(); + for (File file : temp) { + boolean ignored = file.delete(); + } + + // Prepare for Linkage + SolverDescription mySolverDescription = getSimulationJob().getSimulation().getSolverTaskDescription().getSolverDescription(); + File localSolverPath = SolverUtilities.getExes(mySolverDescription)[0]; + + // Perform linkage + this.linkAllDependenciesOf(localSolverPath, localSolverPath.getParentFile(), mySolverLinkDir); + lg.trace(String.format("Setting env var `%s` to: \"%s\"", "LD_LIBRARY_PATH", mySolverLinkDir.getAbsolutePath())); + getMathExecutable().addEnvironmentVariable("LD_LIBRARY_PATH", mySolverLinkDir.getAbsolutePath()); + + } + + private void linkAllDependenciesOf(File dependency, File sourceDirectory, File targetLinkDirectory) throws IOException, InterruptedException { + File[] directoryContents = sourceDirectory.listFiles(); + if (directoryContents == null) throw new NullPointerException(); + Set allPotentialDependencies = Stream.of(directoryContents) + .filter(AbstractCompiledSolver::isDependency).collect(Collectors.toSet()); + Map dependencyToFileMapping = new HashMap<>(); + for (File dep : allPotentialDependencies){ + dependencyToFileMapping.put(dep.getName(), dep); + } + Map setOfDepsToLink = this.getDependenciesNeeded(dependency, dependencyToFileMapping, new HashSet<>()); + + for (String depName : setOfDepsToLink.keySet()){ + Path ignored = AbstractCompiledSolver.createSymbolicLink(targetLinkDirectory, depName, dependencyToFileMapping.get(setOfDepsToLink.get(depName))); + } + } + + private Map getDependenciesNeeded(String startingDependencyName, Map availableDependencies, + Set alreadyProcessedDependencies) throws IOException, InterruptedException { + if (availableDependencies.containsKey(startingDependencyName)) { + return this.getDependenciesNeeded( + availableDependencies.get(startingDependencyName), availableDependencies, alreadyProcessedDependencies); + } else { + lg.warn("Warning: exact dependency not found by name; trying to stitch together an alternative."); + for (String alternate : availableDependencies.keySet()){ + if (!startingDependencyName.startsWith(alternate)) continue; + Path stichedPath = Paths.get(availableDependencies.get(alternate).getParent(), startingDependencyName); + lg.info("Alternative found; attempting to link stitched dependency."); + return this.getDependenciesNeeded(stichedPath.toFile(), availableDependencies, alreadyProcessedDependencies); } - - java.io.BufferedReader br = new java.io.BufferedReader(new java.io.StringReader(sb.toString())); - String line = null; -// System.out.println("-----reading ldd:"); - while ((line = br.readLine()) != null) { -// System.out.println(line); - java.util.StringTokenizer libInfo = new java.util.StringTokenizer(line, " \t"); - if (libInfo.countTokens() == 4) {// "libname => libpath offset" -or- "libname => not found" - String libName = libInfo.nextToken(); - String ptr = libInfo.nextToken(); - String libPath = libInfo.nextToken(); - String aux = libInfo.nextToken(); - if (libPath.equals("not") && aux.equals("found")) { - boolean bMatch = false; - for (int i = 0; i < libzipSolverFiles.length; i++) { - if (libzipSolverFiles[i].getName().startsWith(libName) && libzipSolverFiles[i].length() != 0) { - //System.out.println(libName+" "+ptr+" "+libPath+" "+aux+" "+org.apache.commons.lang3.StringUtils.getJaroWinklerDistance("libhdf5.so",libName)); -// System.out.println(libName+" "+ptr+" "+libPath+" "+aux+" match="+libzipSolverFiles[i]); - createSymbolicLink(mySolverLinkDir, libName, libzipSolverFiles[i]); - bMatch = true; - break; - } - } - if (!bMatch) { - for (int i = 0; i < libzipSolverFiles.length; i++) { - int index = libName.indexOf(".so"); - if (index != -1) { - String matchName = libName.substring(0, index + 3); - if (libzipSolverFiles[i].getName().startsWith(matchName) && libzipSolverFiles[i].length() != 0) { -// System.out.println("ALTERNATE "+libName+" "+ptr+" "+libPath+" "+aux+" match="+libzipSolverFiles[i]); - createSymbolicLink(mySolverLinkDir, libName, libzipSolverFiles[i]); - break; - } - } - } - } - } - } + throw new RuntimeException("No alternatives possible for missing dependency: `" + startingDependencyName + "`"); + } + } + + private Map getDependenciesNeeded(File startingDependency, Map availableDependencies, + Set alreadyProcessedDependencies) throws IOException, InterruptedException { + Map dependenciesNeeded = new HashMap<>(); + File dependency; + if (availableDependencies.containsKey(startingDependency.getName())){ + dependency = availableDependencies.get(startingDependency.getName()); + } else { // Determine alternative options + int locationOfExtension = startingDependency.getName().indexOf(".so"); + if (locationOfExtension == -1) throw new RuntimeException("Dependency " + startingDependency.getName() + " not found in available dependencies"); + lg.warn("Warning: exact dependency not found by name; searching for inexact match..."); + String shortName = startingDependency.getName().substring(0, locationOfExtension + 3); + String dependencyToAdd = this.getEntryStartingWith(shortName, availableDependencies.keySet()); + if (dependencyToAdd == null) throw new RuntimeException("No alternatives possible for missing dependency: `" + startingDependency.getName() + "`"); + lg.info("Alternative successfully found; preparing to link."); + dependency = availableDependencies.get(dependencyToAdd); + alreadyProcessedDependencies.add(startingDependency.getName()); + } + if (alreadyProcessedDependencies.contains(dependency.getName())) return new HashMap<>(); // Already done + dependenciesNeeded.put(startingDependency.getName(), dependency.getName()); + String lddRawResults = AbstractCompiledSolver.getLddResult(dependency); + + //Try to save output to file for cli without interfering with further processing + File stdOutFile = new File(String.valueOf(Paths.get(System.getProperty("user.dir"))), "stdOut.txt"); + try (BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(stdOutFile))){ + bos.write(lddRawResults.getBytes()); + } catch(Exception e) { + lg.error(e.getMessage(), e); + } + + // Begin Parsing + try (BufferedReader br = new BufferedReader(new StringReader(lddRawResults))) { + for (String line = br.readLine(); line != null; line = br.readLine()){ + StringTokenizer libInfo = new StringTokenizer(line, " \t"); + if (libInfo.countTokens() != 4) continue; // We do not care about these + // If we have 4 tokens, we have one of two cases: + // >> Case 1: ,"=>",, + // >> Case 2: ,"=>","not","found" (<-- this is the case we want to identify!) + String libName = libInfo.nextToken(); + String ignored = libInfo.nextToken(); // "=>" + String libPath = libInfo.nextToken(); + String aux = libInfo.nextToken(); + + if (!libPath.equals("not") || !aux.equals("found")) continue; // We only care about Case 2 + dependenciesNeeded.putAll(this.getDependenciesNeeded( + libName, availableDependencies, alreadyProcessedDependencies)); + } + } + alreadyProcessedDependencies.add(dependency.getName()); + return dependenciesNeeded; + } -// System.out.println("-----Setting executable "+LD_LIB_PATH+" to "+newLD_LIB_PATH); - getMathExecutable().addEnvironmentVariable(LD_LIB_PATH, newLD_LIB_PATH); - }else if (OperatingSystemInfo.getInstance().isMac()) { - getMathExecutable().addEnvironmentVariable("HDF5_DISABLE_VERSION_CHECK", "1"); - } + private static String getLddResult(File solverToResolve) throws IOException, InterruptedException { + ProcessBuilder pb = new ProcessBuilder("ldd", solverToResolve.toPath().toString()); + pb.redirectErrorStream(true); + Process p = pb.start(); + StringBuilder sb = new StringBuilder(); + // Can we pull inputStream outside the for-loop? + for (int ioByte = p.getInputStream().read(); ioByte != -1; ioByte = p.getInputStream().read()){ + sb.append((char) ioByte); + } + p.waitFor(); + return sb.toString(); + } + + private static boolean isDependency(File potentialDependency){ + return potentialDependency.isFile() + && potentialDependency.length() != 0 + && !Files.isSymbolicLink(potentialDependency.toPath()) + && !potentialDependency.getName().startsWith("."); + } + + private String getEntryStartingWith(String shortName, Set candidates){ + for (String candidate : candidates) if (candidate.startsWith(shortName)) return candidate; + return null; } /** @@ -317,11 +360,7 @@ protected void setMathExecutable(MathExecutable newMathExecutable) { public synchronized final void startSolver() { if (!(fieldThread != null && fieldThread.isAlive())) { setMathExecutable(null); - fieldThread = new Thread() { - public void run() { - runSolver(); - } - }; + fieldThread = new Thread(this::runSolver); fieldThread.setName("Compiled Solver (" + getClass().getName() + ")"); fieldThread.start(); } diff --git a/vcell-core/src/main/java/cbit/vcell/solvers/AbstractSolver.java b/vcell-core/src/main/java/cbit/vcell/solvers/AbstractSolver.java index 28fc2cdbbf..b59d9e1140 100644 --- a/vcell-core/src/main/java/cbit/vcell/solvers/AbstractSolver.java +++ b/vcell-core/src/main/java/cbit/vcell/solvers/AbstractSolver.java @@ -20,13 +20,13 @@ import cbit.vcell.math.Constant; import cbit.vcell.math.MathUtilities; import cbit.vcell.math.VolVariable; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.mongodb.VCMongoMessage; import cbit.vcell.parser.Expression; import cbit.vcell.parser.ExpressionException; import cbit.vcell.simdata.SimDataConstants; -import cbit.vcell.solver.SimulationJob; -import cbit.vcell.solver.SimulationSymbolTable; +import cbit.vcell.solver.simulation.SimulationJob; +import cbit.vcell.solver.simulation.SimulationSymbolTable; import cbit.vcell.solver.SolverException; import cbit.vcell.solver.ode.ODEStateVariable; import cbit.vcell.solver.ode.SensStateVariable; @@ -49,13 +49,13 @@ public abstract class AbstractSolver implements Solver, SimDataConstants { private SolverStatus fieldSolverStatus = new SolverStatus(SolverStatus.SOLVER_READY, SimulationMessage.MESSAGE_SOLVER_READY); private File saveDirectory = null; private boolean saveEnabled = true; - protected final SimulationTask simTask; + protected final StandardSimulationTask simTask; public static boolean bMakeUserDirs = true; /** * AbstractSolver constructor comment. */ -public AbstractSolver(SimulationTask simTask, File directory) throws SolverException { +public AbstractSolver(StandardSimulationTask simTask, File directory) throws SolverException { this.simTask = simTask; if (!directory.exists() && !simTask.getSimulation().getSolverTaskDescription().isParallel()){ diff --git a/vcell-core/src/main/java/cbit/vcell/solvers/CombinedSundialsSolver.java b/vcell-core/src/main/java/cbit/vcell/solvers/CombinedSundialsSolver.java index 4a5d5ff762..ddbba2b479 100644 --- a/vcell-core/src/main/java/cbit/vcell/solvers/CombinedSundialsSolver.java +++ b/vcell-core/src/main/java/cbit/vcell/solvers/CombinedSundialsSolver.java @@ -13,7 +13,7 @@ import java.io.File; import java.util.Vector; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.solver.AnnotatedFunction; import cbit.vcell.solver.SolverException; import cbit.vcell.solver.ode.CVodeSolverStandalone; @@ -33,12 +33,12 @@ public class CombinedSundialsSolver extends SimpleCompiledSolver implements ODES /** * LSFSolver constructor comment. - * @param simulation cbit.vcell.solver.Simulation + * @param simulation cbit.vcell.solver.simulation.Simulation * @param directory java.io.File * @param sessionLog cbit.vcell.server.SessionLog * @exception cbit.vcell.solver.SolverException The exception description. */ -public CombinedSundialsSolver(SimulationTask simTask, File directory, boolean bMessaging) throws cbit.vcell.solver.SolverException { +public CombinedSundialsSolver(StandardSimulationTask simTask, File directory, boolean bMessaging) throws cbit.vcell.solver.SolverException { super(simTask, directory, bMessaging); if (simTask.getSimulation().getMathDescription().hasFastSystems()) { realSolver = new IDASolverStandalone(simTask, directory, bMessaging); diff --git a/vcell-core/src/main/java/cbit/vcell/solvers/FVSolverStandalone.java b/vcell-core/src/main/java/cbit/vcell/solvers/FVSolverStandalone.java index 4289e4f1b2..7c3295c155 100644 --- a/vcell-core/src/main/java/cbit/vcell/solvers/FVSolverStandalone.java +++ b/vcell-core/src/main/java/cbit/vcell/solvers/FVSolverStandalone.java @@ -23,7 +23,6 @@ import java.util.Vector; import org.vcell.chombo.ChomboSolverSpec; -import org.vcell.util.BeanUtils; import org.vcell.util.DataAccessException; import org.vcell.util.ISize; import org.vcell.util.document.SimResampleInfoProvider; @@ -34,7 +33,7 @@ import cbit.vcell.geometry.Geometry; import cbit.vcell.geometry.surface.GeometrySurfaceDescription; import cbit.vcell.math.Variable; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.parser.Expression; import cbit.vcell.parser.ExpressionException; import cbit.vcell.resource.PropertyLoader; @@ -42,13 +41,12 @@ import cbit.vcell.simdata.DataSetControllerImpl; import cbit.vcell.simdata.SimDataConstants; import cbit.vcell.solver.AnnotatedFunction; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationJob; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationJob; import cbit.vcell.solver.SolverDescription; import cbit.vcell.solver.SolverException; import cbit.vcell.solver.SolverTaskDescription; import cbit.vcell.solver.SolverUtilities; -import cbit.vcell.solver.VCSimulationDataIdentifier; import cbit.vcell.solver.server.SimulationMessage; import cbit.vcell.solver.server.SolverStatus; @@ -78,11 +76,11 @@ public class FVSolverStandalone extends AbstractCompiledSolver { public static final int HESM_THROW_EXCEPTION = 1; public static final int HESM_OVERWRITE_AND_CONTINUE = 2; - public FVSolverStandalone(SimulationTask simTask, File userDir, boolean bMsging) throws SolverException{ + public FVSolverStandalone(StandardSimulationTask simTask, File userDir, boolean bMsging) throws SolverException{ this(simTask, userDir, userDir, bMsging); } - public FVSolverStandalone(SimulationTask simTask, File userDir, File destinationDirectory, boolean bMsging) throws SolverException{ + public FVSolverStandalone(StandardSimulationTask simTask, File userDir, File destinationDirectory, boolean bMsging) throws SolverException{ super(simTask, userDir, bMsging); String nullMessageFormat = "`%s` value is unexpectedly null"; SolverDescription sd = FVSolverStandalone.getSolverDescription(simTask, nullMessageFormat); @@ -98,9 +96,9 @@ public FVSolverStandalone(SimulationTask simTask, File userDir, File destination } - private static SolverDescription getSolverDescription(SimulationTask simTask, String nullMessageFormat) throws SolverException{ + private static SolverDescription getSolverDescription(StandardSimulationTask simTask, String nullMessageFormat) throws SolverException{ if(simTask == null) - throw new NullPointerException(String.format(nullMessageFormat, SimulationTask.class.getName())); + throw new NullPointerException(String.format(nullMessageFormat, StandardSimulationTask.class.getName())); Simulation sim = simTask.getSimulation(); if(sim == null) throw new NullPointerException(String.format(nullMessageFormat, Simulation.class.getName())); if(!sim.isSpatial()){ diff --git a/vcell-core/src/main/java/cbit/vcell/solvers/FiniteVolumeFileWriter.java b/vcell-core/src/main/java/cbit/vcell/solvers/FiniteVolumeFileWriter.java index 6e5523e864..5abc355536 100644 --- a/vcell-core/src/main/java/cbit/vcell/solvers/FiniteVolumeFileWriter.java +++ b/vcell-core/src/main/java/cbit/vcell/solvers/FiniteVolumeFileWriter.java @@ -93,7 +93,7 @@ import cbit.vcell.math.VolumeRandomVariable; import cbit.vcell.math.VolumeRegionEquation; import cbit.vcell.math.VolumeRegionVariable; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.parser.Discontinuity; import cbit.vcell.parser.DivideByZeroException; import cbit.vcell.parser.Expression; @@ -112,8 +112,8 @@ import cbit.vcell.solver.ErrorTolerance; import cbit.vcell.solver.MathOverrides; import cbit.vcell.solver.OutputTimeSpec; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationSymbolTable; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationSymbolTable; import cbit.vcell.solver.SmoldynSimulationOptions; import cbit.vcell.solver.SolverDescription; import cbit.vcell.solver.SolverException; @@ -254,16 +254,16 @@ enum FVInputFileKeyword { SMOLDYN_STEP_MULTIPLIER, } - public FiniteVolumeFileWriter(PrintWriter pw, SimulationTask simTask, Geometry geo, File workingDir){ // for optimization only, no messaging + public FiniteVolumeFileWriter(PrintWriter pw, StandardSimulationTask simTask, Geometry geo, File workingDir){ // for optimization only, no messaging this(pw, simTask, geo, workingDir, false); bInlineVCG = true; } - public FiniteVolumeFileWriter(PrintWriter pw, SimulationTask simTask, Geometry geo, File workingDir, boolean arg_bMessaging){ + public FiniteVolumeFileWriter(PrintWriter pw, StandardSimulationTask simTask, Geometry geo, File workingDir, boolean arg_bMessaging){ this(pw, simTask, geo, workingDir, workingDir, arg_bMessaging); } - public FiniteVolumeFileWriter(PrintWriter pw, SimulationTask simTask, Geometry geo, File workingDir, File destinationDirectory, boolean arg_bMessaging){ + public FiniteVolumeFileWriter(PrintWriter pw, StandardSimulationTask simTask, Geometry geo, File workingDir, File destinationDirectory, boolean arg_bMessaging){ super(pw, simTask, arg_bMessaging); resampledGeometry = geo; this.workingDirectory = workingDir; @@ -857,7 +857,7 @@ private void writeBoundaryConditions(BoundaryConditionType[] bctypes){ } } - public static String replaceVolumeVariable(SimulationTask simTask, MembraneSubDomain msd, Expression exp) throws MathException, ExpressionException{ + public static String replaceVolumeVariable(StandardSimulationTask simTask, MembraneSubDomain msd, Expression exp) throws MathException, ExpressionException{ Expression fluxExpr = new Expression(exp); String symbols[] = exp.getSymbols(); String flux = null; diff --git a/vcell-core/src/main/java/cbit/vcell/solvers/HTCSolver.java b/vcell-core/src/main/java/cbit/vcell/solvers/HTCSolver.java index e4d71ef79c..be73f7b7ba 100644 --- a/vcell-core/src/main/java/cbit/vcell/solvers/HTCSolver.java +++ b/vcell-core/src/main/java/cbit/vcell/solvers/HTCSolver.java @@ -17,7 +17,7 @@ import org.vcell.util.exe.Executable; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.resource.PropertyLoader; import cbit.vcell.solver.SolverException; import cbit.vcell.solver.server.SolverEvent; @@ -34,9 +34,9 @@ public abstract class HTCSolver extends AbstractSolver { protected AbstractSolver realSolver = null; protected ArrayList cmdArguments = new ArrayList(); - protected SimulationTask simulationTask = null; + protected StandardSimulationTask simulationTask = null; -public HTCSolver(SimulationTask simTask, File userDirectory, File parallelDirectory) throws SolverException { +public HTCSolver(StandardSimulationTask simTask, File userDirectory, File parallelDirectory) throws SolverException { super(simTask, userDirectory); simulationTask = simTask; if (!simTask.getSimulation().getSolverTaskDescription().getSolverDescription().isJavaSolver()) { diff --git a/vcell-core/src/main/java/cbit/vcell/solvers/LocalSolverController.java b/vcell-core/src/main/java/cbit/vcell/solvers/LocalSolverController.java index 68a9e48bf3..8dde708f89 100644 --- a/vcell-core/src/main/java/cbit/vcell/solvers/LocalSolverController.java +++ b/vcell-core/src/main/java/cbit/vcell/solvers/LocalSolverController.java @@ -20,9 +20,9 @@ import cbit.rmi.event.WorkerEvent; import cbit.rmi.event.WorkerEventListener; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.server.VCellConnection; -import cbit.vcell.solver.SimulationJob; +import cbit.vcell.solver.simulation.SimulationJob; import cbit.vcell.solver.SolverException; import cbit.vcell.solver.VCSimulationDataIdentifier; import cbit.vcell.solver.server.SimulationMessage; @@ -53,7 +53,7 @@ public class LocalSolverController implements SolverListener { * @exception java.rmi.RemoteException The exception description. * @throws SolverException */ -public LocalSolverController(VCellConnection vcellConnection, SimulationTask simTask, File dataDirectory) throws SolverException { +public LocalSolverController(VCellConnection vcellConnection, StandardSimulationTask simTask, File dataDirectory) throws SolverException { this.vcConn = vcellConnection; solverControllerImpl = new SolverControllerImpl(vcellConnection, simTask, dataDirectory); solverControllerImpl.getSolver().addSolverListener(this); @@ -114,7 +114,7 @@ public double getProgress() throws DataAccessException { /** * getMathDescriptionVCML method comment. */ -public SimulationTask getSimulationTask() throws DataAccessException { +public StandardSimulationTask getSimulationTask() throws DataAccessException { try { return solverControllerImpl.getSimulationTask(); }catch (Throwable e){ @@ -164,7 +164,7 @@ public void solverAborted(SolverEvent event) { if (lg.isTraceEnabled()) lg.trace("LocalSolverController Caught solverAborted("+event.getSource().toString()+",error='"+event.getSimulationMessage()+"')"); SimulationJob simJob = getSimulationTask().getSimulationJob(); if (serialParameterScanJobIndex >= 0) { - SimulationTask newSimTask = new SimulationTask(new SimulationJob(simJob.getSimulation(), serialParameterScanJobIndex, simJob.getFieldDataIdentifierSpecs()),getSimulationTask().getTaskID()); + StandardSimulationTask newSimTask = new StandardSimulationTask(new SimulationJob(simJob.getSimulation(), serialParameterScanJobIndex, simJob.getFieldDataIdentifierSpecs()),getSimulationTask().getTaskID()); fireWorkerEvent(new WorkerEvent(WorkerEvent.JOB_FAILURE, this, newSimTask, hostname, event.getSimulationMessage())); } else { fireWorkerEvent(new WorkerEvent(WorkerEvent.JOB_FAILURE, this, getSimulationTask(), hostname, event.getSimulationMessage())); @@ -184,7 +184,7 @@ public void solverFinished(SolverEvent event) { if (lg.isTraceEnabled()) lg.trace("LocalSolverController Caught solverFinished("+event.getSource().toString()+")"); SimulationJob simJob = getSimulationTask().getSimulationJob(); if (serialParameterScanJobIndex >= 0) { - SimulationTask newSimTask = new SimulationTask(new SimulationJob(simJob.getSimulation(), serialParameterScanJobIndex, simJob.getFieldDataIdentifierSpecs()),getSimulationTask().getTaskID()); + StandardSimulationTask newSimTask = new StandardSimulationTask(new SimulationJob(simJob.getSimulation(), serialParameterScanJobIndex, simJob.getFieldDataIdentifierSpecs()),getSimulationTask().getTaskID()); fireWorkerEvent(new WorkerEvent(WorkerEvent.JOB_COMPLETED, this, newSimTask, hostname, new Double(event.getProgress()), new Double(event.getTimePoint()), event.getSimulationMessage())); } else { fireWorkerEvent(new WorkerEvent(WorkerEvent.JOB_COMPLETED, this, getSimulationTask(), hostname, new Double(event.getProgress()), new Double(event.getTimePoint()), event.getSimulationMessage())); @@ -220,7 +220,7 @@ public void solverProgress(SolverEvent event) { // don't log progress and data events if (System.currentTimeMillis() - timeOfLastProgressMessage > 1000 * getMessagingInterval()) { if (serialParameterScanJobIndex >= 0) { - SimulationTask newSimTask = new SimulationTask(new SimulationJob(getSimulationTask().getSimulation(), serialParameterScanJobIndex, getSimulationTask().getSimulationJob().getFieldDataIdentifierSpecs()),getSimulationTask().getTaskID()); + StandardSimulationTask newSimTask = new StandardSimulationTask(new SimulationJob(getSimulationTask().getSimulation(), serialParameterScanJobIndex, getSimulationTask().getSimulationJob().getFieldDataIdentifierSpecs()),getSimulationTask().getTaskID()); fireWorkerEvent(new WorkerEvent(WorkerEvent.JOB_PROGRESS, this, newSimTask, hostname, new Double(event.getProgress()), new Double(event.getTimePoint()), event.getSimulationMessage())); if (event.getProgress() >= 1) { fireWorkerEvent(new WorkerEvent(WorkerEvent.JOB_COMPLETED, this, newSimTask, hostname, new Double(event.getProgress()), new Double(event.getTimePoint()), SimulationMessage.MESSAGE_JOB_COMPLETED)); @@ -244,7 +244,7 @@ public void solverStarting(SolverEvent event) { try { if (lg.isTraceEnabled()) lg.trace("LocalSolverController Caught solverStarting("+event.getSource().toString()+")"); if (serialParameterScanJobIndex >= 0) { - SimulationTask newSimTask = new SimulationTask(new SimulationJob(getSimulationTask().getSimulation(), serialParameterScanJobIndex, getSimulationTask().getSimulationJob().getFieldDataIdentifierSpecs()),getSimulationTask().getTaskID()); + StandardSimulationTask newSimTask = new StandardSimulationTask(new SimulationJob(getSimulationTask().getSimulation(), serialParameterScanJobIndex, getSimulationTask().getSimulationJob().getFieldDataIdentifierSpecs()),getSimulationTask().getTaskID()); fireWorkerEvent(new WorkerEvent(WorkerEvent.JOB_STARTING, this, newSimTask, hostname, event.getSimulationMessage())); } else { fireWorkerEvent(new WorkerEvent(WorkerEvent.JOB_STARTING, this, getSimulationTask(), hostname, event.getSimulationMessage())); diff --git a/vcell-core/src/main/java/cbit/vcell/solvers/MovingBoundaryFileWriter.java b/vcell-core/src/main/java/cbit/vcell/solvers/MovingBoundaryFileWriter.java index e93cbeef96..67d52b06e3 100644 --- a/vcell-core/src/main/java/cbit/vcell/solvers/MovingBoundaryFileWriter.java +++ b/vcell-core/src/main/java/cbit/vcell/solvers/MovingBoundaryFileWriter.java @@ -39,7 +39,7 @@ import cbit.vcell.math.VolVariable; import cbit.vcell.message.VCellQueue; import cbit.vcell.message.VCellTopic; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.parser.Expression; import cbit.vcell.parser.ExpressionException; import cbit.vcell.parser.SymbolTable; @@ -47,8 +47,8 @@ import cbit.vcell.resource.PropertyLoader; import cbit.vcell.solver.DefaultOutputTimeSpec; import cbit.vcell.solver.OutputTimeSpec; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationSymbolTable; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationSymbolTable; import cbit.vcell.solver.SolverException; import cbit.vcell.solver.SolverTaskDescription; import cbit.vcell.solver.SolverUtilities; @@ -75,7 +75,7 @@ public class MovingBoundaryFileWriter extends SolverFileWriter { */ private Element problem; - public MovingBoundaryFileWriter(PrintWriter pw, SimulationTask simTask, Geometry resampledGeometry, boolean arg_bMessaging, String outputPrefix, + public MovingBoundaryFileWriter(PrintWriter pw, StandardSimulationTask simTask, Geometry resampledGeometry, boolean arg_bMessaging, String outputPrefix, MovingBoundarySolverSpec mbss){ super(pw, simTask, arg_bMessaging); @@ -86,7 +86,7 @@ public MovingBoundaryFileWriter(PrintWriter pw, SimulationTask simTask, Geometry solverSpec = mbss; } - public MovingBoundaryFileWriter(PrintWriter pw, SimulationTask simTask, Geometry resampledGeometry, boolean arg_bMessaging, String outputPrefix){ + public MovingBoundaryFileWriter(PrintWriter pw, StandardSimulationTask simTask, Geometry resampledGeometry, boolean arg_bMessaging, String outputPrefix){ this(pw, simTask, resampledGeometry, arg_bMessaging, outputPrefix, new MovingBoundarySolverSpec()); } @@ -144,7 +144,7 @@ private int subdomainsSanityCheck(){ // // XML producer - here all the work is done // - public Element writeMovingBoundaryXML(SimulationTask simTask) throws SolverException{ + public Element writeMovingBoundaryXML(StandardSimulationTask simTask) throws SolverException{ try { int subdomainsWithPdeEquations = subdomainsSanityCheck(); if(subdomainsWithPdeEquations != 1){ diff --git a/vcell-core/src/main/java/cbit/vcell/solvers/MovingBoundarySolver.java b/vcell-core/src/main/java/cbit/vcell/solvers/MovingBoundarySolver.java index 58c399ab6d..2c21b4f930 100644 --- a/vcell-core/src/main/java/cbit/vcell/solvers/MovingBoundarySolver.java +++ b/vcell-core/src/main/java/cbit/vcell/solvers/MovingBoundarySolver.java @@ -18,7 +18,7 @@ import cbit.vcell.geometry.Geometry; import cbit.vcell.geometry.surface.GeometrySurfaceDescription; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.solver.SolverDescription; import cbit.vcell.solver.SolverException; import cbit.vcell.solver.SolverUtilities; @@ -48,7 +48,7 @@ public class MovingBoundarySolver extends SimpleCompiledSolver { * @param simID java.lang.String * @param clientProxy cbit.vcell.solvers.ClientProxy */ -public MovingBoundarySolver (SimulationTask simTask, File dir, boolean bMsging) throws SolverException { +public MovingBoundarySolver (StandardSimulationTask simTask, File dir, boolean bMsging) throws SolverException { super(simTask, dir, bMsging); if (! simTask.getSimulation().isSpatial()) { throw new SolverException("Cannot use MovingBoundary on non-spatial simulation"); @@ -82,7 +82,7 @@ public void cleanup() { * Insert the method's description here. * Creation date: (2/2/2004 5:31:41 PM) * @return cbit.vcell.simdata.AnnotatedFunction[] - * @param simulation cbit.vcell.solver.Simulation + * @param simulation cbit.vcell.solver.simulation.Simulation */ //@Override //public Vector createFunctionList() { diff --git a/vcell-core/src/main/java/cbit/vcell/solvers/SimpleCompiledSolver.java b/vcell-core/src/main/java/cbit/vcell/solvers/SimpleCompiledSolver.java index a1e5a62f08..f85f68ad1c 100644 --- a/vcell-core/src/main/java/cbit/vcell/solvers/SimpleCompiledSolver.java +++ b/vcell-core/src/main/java/cbit/vcell/solvers/SimpleCompiledSolver.java @@ -4,7 +4,7 @@ import java.util.Arrays; import java.util.Collection; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.resource.ResourceUtil; import cbit.vcell.solver.SolverException; @@ -16,7 +16,7 @@ public abstract class SimpleCompiledSolver extends AbstractCompiledSolver { - public SimpleCompiledSolver(SimulationTask simTask, File directory, boolean bMsging) throws SolverException { + public SimpleCompiledSolver(StandardSimulationTask simTask, File directory, boolean bMsging) throws SolverException { super(simTask, directory, bMsging); } diff --git a/vcell-core/src/main/java/cbit/vcell/solvers/SolverControllerImpl.java b/vcell-core/src/main/java/cbit/vcell/solvers/SolverControllerImpl.java index b604508d34..290cf75dfa 100644 --- a/vcell-core/src/main/java/cbit/vcell/solvers/SolverControllerImpl.java +++ b/vcell-core/src/main/java/cbit/vcell/solvers/SolverControllerImpl.java @@ -12,7 +12,7 @@ import java.io.File; import java.util.Date; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.server.VCellConnection; import cbit.vcell.solver.server.Solver; import cbit.vcell.solver.server.SolverListener; @@ -27,7 +27,7 @@ public class SolverControllerImpl { private VCellConnection vcConn = null; private SolverListener solverListener = null; - private SimulationTask simulationTask = null; + private StandardSimulationTask simulationTask = null; private Solver solver = null; private File directory = null; private Date startDate = null; @@ -40,7 +40,7 @@ public class SolverControllerImpl { * @param directory java.lang.String * @param simIdentifier java.lang.String */ -public SolverControllerImpl (VCellConnection argVCellConnection, SimulationTask simulationTask, java.io.File directory) throws cbit.vcell.solver.SolverException { +public SolverControllerImpl (VCellConnection argVCellConnection, StandardSimulationTask simulationTask, java.io.File directory) throws cbit.vcell.solver.SolverException { this.simulationTask = simulationTask; this.directory = directory; this.vcConn = argVCellConnection; @@ -64,7 +64,7 @@ public Date getEndDate() { * This method was created by a SmartGuide. * @return cbit.vcell.math.MathDescription */ -public SimulationTask getSimulationTask() { +public StandardSimulationTask getSimulationTask() { return simulationTask; } diff --git a/vcell-core/src/main/java/cbit/vcell/util/AmplistorUtils.java b/vcell-core/src/main/java/cbit/vcell/util/AmplistorUtils.java index 0d708b686a..d8d0ed8624 100644 --- a/vcell-core/src/main/java/cbit/vcell/util/AmplistorUtils.java +++ b/vcell-core/src/main/java/cbit/vcell/util/AmplistorUtils.java @@ -44,7 +44,7 @@ import cbit.util.xml.XmlUtil; import cbit.vcell.resource.PropertyLoader; import cbit.vcell.simdata.SimulationData; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; public class AmplistorUtils { private final static Logger lg = LogManager.getLogger(AmplistorUtils.class); diff --git a/vcell-core/src/main/java/cbit/vcell/xml/XmlHelper.java b/vcell-core/src/main/java/cbit/vcell/xml/XmlHelper.java index 929d6732e5..34335e32cd 100644 --- a/vcell-core/src/main/java/cbit/vcell/xml/XmlHelper.java +++ b/vcell-core/src/main/java/cbit/vcell/xml/XmlHelper.java @@ -10,13 +10,11 @@ package cbit.vcell.xml; -import cbit.image.ImageException; import cbit.image.VCImage; import cbit.util.xml.VCLogger; import cbit.util.xml.VCLoggerException; import cbit.util.xml.XmlUtil; import cbit.vcell.biomodel.BioModel; -import cbit.vcell.biomodel.BioModelTransforms; import cbit.vcell.biomodel.ModelUnitConverter; import cbit.vcell.biomodel.meta.IdentifiableProvider; import cbit.vcell.biomodel.meta.VCMetaData; @@ -24,22 +22,14 @@ import cbit.vcell.biomodel.meta.xml.XMLMetaDataWriter; import cbit.vcell.field.FieldDataIdentifierSpec; import cbit.vcell.geometry.Geometry; -import cbit.vcell.geometry.GeometryException; -import cbit.vcell.mapping.MappingException; -import cbit.vcell.mapping.MathMapping; -import cbit.vcell.mapping.MathSymbolMapping; import cbit.vcell.mapping.SimulationContext; import cbit.vcell.math.MathDescription; import cbit.vcell.mathmodel.MathModel; -import cbit.vcell.messaging.server.SimulationTask; -import cbit.vcell.model.Kinetics; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.model.ModelUnitSystem; -import cbit.vcell.model.Parameter; -import cbit.vcell.model.ReactionStep; -import cbit.vcell.parser.Expression; import cbit.vcell.parser.ExpressionException; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.*; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationJob; import cbit.xml.merge.NodeInfo; import cbit.xml.merge.XmlTreeDiff; import cbit.xml.merge.XmlTreeDiff.DiffConfiguration; @@ -53,7 +43,6 @@ import org.vcell.sbml.vcell.MathModel_SBMLExporter; import org.vcell.sbml.vcell.SBMLAnnotationUtil; import org.vcell.sbml.vcell.SBMLExporter; -import org.vcell.sbml.vcell.SBMLImportException; import org.vcell.sbml.vcell.SBMLImporter; import org.vcell.sedml.SEDMLImporter; import org.vcell.util.Extent; @@ -61,21 +50,9 @@ import org.vcell.util.TokenMangler; import org.vcell.util.document.VCDocument; import org.vcell.util.document.VCellSoftwareVersion; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.xml.sax.InputSource; -import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.stream.XMLStreamException; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; -import javax.xml.xpath.XPath; -import javax.xml.xpath.XPathConstants; -import javax.xml.xpath.XPathFactory; - -import java.beans.PropertyVetoException; + import java.io.*; import java.util.*; @@ -794,7 +771,7 @@ public static Simulation XMLToSim(String xmlString) throws XmlParseException { private static final String JobIndex_attr = "JobIndex"; private static final String powerUser_attr = "isPowerUser"; - public static String simTaskToXML(SimulationTask simTask) throws XmlParseException { + public static String simTaskToXML(StandardSimulationTask simTask) throws XmlParseException { String simTaskString = null; @@ -852,7 +829,7 @@ public static String simTaskToXML(SimulationTask simTask) throws XmlParseExcepti return simTaskString; } - public static SimulationTask XMLToSimTask(String xmlString) throws XmlParseException, ExpressionException { + public static StandardSimulationTask XMLToSimTask(String xmlString) throws XmlParseException, ExpressionException { Namespace ns = Namespace.getNamespace(XMLTags.VCML_NS); @@ -896,7 +873,7 @@ public static SimulationTask XMLToSimTask(String xmlString) throws XmlParseExcep sim.refreshDependencies(); SimulationJob simJob = new SimulationJob(sim,jobIndex,fdisArray); - SimulationTask simTask = new SimulationTask(simJob,taskId,computeResource,isPowerUser); + StandardSimulationTask simTask = new StandardSimulationTask(simJob,taskId,computeResource,isPowerUser); return simTask; } catch (Exception pve) { diff --git a/vcell-core/src/main/java/cbit/vcell/xml/XmlReader.java b/vcell-core/src/main/java/cbit/vcell/xml/XmlReader.java index d009984e20..17928eb9ee 100644 --- a/vcell-core/src/main/java/cbit/vcell/xml/XmlReader.java +++ b/vcell-core/src/main/java/cbit/vcell/xml/XmlReader.java @@ -17,6 +17,8 @@ import cbit.vcell.model.*; import cbit.vcell.solver.*; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationOwner; import org.jdom.Attribute; import org.jdom.DataConversionException; import org.jdom.Element; @@ -40,7 +42,6 @@ import org.vcell.pathway.persistence.RDFXMLContext; import org.vcell.relationship.RelationshipModel; import org.vcell.relationship.persistence.RelationshipReader; -import org.vcell.sbml.vcell.StructureSizeSolver; import org.vcell.util.BeanUtils; import org.vcell.util.Commented; import org.vcell.util.Coordinate; @@ -261,7 +262,6 @@ import cbit.vcell.parser.Expression; import cbit.vcell.parser.ExpressionBindingException; import cbit.vcell.parser.ExpressionException; -import cbit.vcell.parser.ParserException; import cbit.vcell.parser.SymbolTableEntry; import cbit.vcell.render.Vect3d; import cbit.vcell.solver.AnnotatedFunction.FunctionCategory; @@ -6507,7 +6507,7 @@ private SimulationVersion getSimulationVersion(Element xmlVersion) throws XmlPar * Creation date: (5/22/2001 10:51:23 AM) * * @param param org.jdom.Element - * @param simulation cbit.vcell.solver.Simulation + * @param simulation cbit.vcell.solver.simulation.Simulation * @return cbit.vcell.solver.SolverTaskDescription */ private SolverTaskDescription getSolverTaskDescription(Element param, Simulation simulation) throws XmlParseException{ diff --git a/vcell-core/src/main/java/cbit/vcell/xml/Xmlproducer.java b/vcell-core/src/main/java/cbit/vcell/xml/Xmlproducer.java index 6c143e19c4..38d56a271b 100644 --- a/vcell-core/src/main/java/cbit/vcell/xml/Xmlproducer.java +++ b/vcell-core/src/main/java/cbit/vcell/xml/Xmlproducer.java @@ -255,7 +255,7 @@ import cbit.vcell.solver.NonspatialStochHybridOptions; import cbit.vcell.solver.NonspatialStochSimOptions; import cbit.vcell.solver.OutputTimeSpec; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; import cbit.vcell.solver.SmoldynSimulationOptions; import cbit.vcell.solver.SolverTaskDescription; import cbit.vcell.solver.SundialsPdeSolverOptions; @@ -1652,7 +1652,7 @@ public Element getXML(SimulationContext param, BioModel bioModel) throws XmlPars //Add Simulations to the simulationSpec if (bioModel!=null){ - cbit.vcell.solver.Simulation simulations[] = bioModel.getSimulations(param); + Simulation simulations[] = bioModel.getSimulations(param); for (int i=0;simulations!=null && i reactionProductBondSites = new HashSet(); static HashSet reactionReactantBondSites = new HashSet(); - public static Element writeNFsimXML(SimulationTask origSimTask, long randomSeed, NFsimSimulationOptions nfsimSimulationOptions, boolean bUseLocationMarks) throws SolverException { + public static Element writeNFsimXML(StandardSimulationTask origSimTask, long randomSeed, NFsimSimulationOptions nfsimSimulationOptions, boolean bUseLocationMarks) throws SolverException { try { System.out.println("VCML ORIGINAL .... START\n"+origSimTask.getSimulation().getMathDescription().getVCML_database()+"\nVCML ORIGINAL .... END\n====================\n"); } catch (MathException e1) { lg.error(e1); } - SimulationTask clonedSimTask = null; + StandardSimulationTask clonedSimTask = null; try { - clonedSimTask = (SimulationTask) BeanUtils.cloneSerializable(origSimTask); + clonedSimTask = (StandardSimulationTask) BeanUtils.cloneSerializable(origSimTask); }catch (Exception eee){ throw new SolverException("failed to clone mathDescription while preparing NFSim input: "+eee.getMessage(), eee); } diff --git a/vcell-core/src/main/java/org/vcell/solver/smoldyn/SmoldynFileWriter.java b/vcell-core/src/main/java/org/vcell/solver/smoldyn/SmoldynFileWriter.java index 8104acd824..73968eca2a 100644 --- a/vcell-core/src/main/java/org/vcell/solver/smoldyn/SmoldynFileWriter.java +++ b/vcell-core/src/main/java/org/vcell/solver/smoldyn/SmoldynFileWriter.java @@ -82,7 +82,7 @@ import cbit.vcell.math.VolumeParticleVariable; import cbit.vcell.message.VCellQueue; import cbit.vcell.message.VCellTopic; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.model.common.VCellErrorMessages; import cbit.vcell.parser.DivideByZeroException; import cbit.vcell.parser.Expression; @@ -99,9 +99,9 @@ import cbit.vcell.solver.DataProcessingInstructions; import cbit.vcell.solver.MeshSpecification; import cbit.vcell.solver.OutputTimeSpec; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationJob; -import cbit.vcell.solver.SimulationSymbolTable; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationJob; +import cbit.vcell.solver.simulation.SimulationSymbolTable; import cbit.vcell.solver.SmoldynSimulationOptions; import cbit.vcell.solver.SolverDescription; import cbit.vcell.solver.SolverException; @@ -203,7 +203,7 @@ enum VCellSmoldynKeyword { private String baseFileName = null; private static final Logger lg = LogManager.getLogger(SmoldynFileWriter.class); - public SmoldynFileWriter(PrintWriter pw, boolean bGraphic, String baseName, SimulationTask simTask, boolean bMessaging){ + public SmoldynFileWriter(PrintWriter pw, boolean bGraphic, String baseName, StandardSimulationTask simTask, boolean bMessaging){ super(pw, simTask, bMessaging); this.bGraphicOpenGL = bGraphic; baseFileName = baseName; diff --git a/vcell-core/src/main/java/org/vcell/solver/smoldyn/SmoldynSolver.java b/vcell-core/src/main/java/org/vcell/solver/smoldyn/SmoldynSolver.java index 0c259dc7f9..7dadf91e2a 100644 --- a/vcell-core/src/main/java/org/vcell/solver/smoldyn/SmoldynSolver.java +++ b/vcell-core/src/main/java/org/vcell/solver/smoldyn/SmoldynSolver.java @@ -18,7 +18,7 @@ import org.vcell.util.ExceptionInterpreter; import cbit.vcell.math.MathException; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.simdata.SimDataConstants; import cbit.vcell.solver.SolverDescription; import cbit.vcell.solver.SolverException; @@ -47,7 +47,7 @@ public class SmoldynSolver extends SimpleCompiledSolver { } -public SmoldynSolver(SimulationTask simTask, java.io.File directory, boolean bMsging) throws SolverException { +public SmoldynSolver(StandardSimulationTask simTask, java.io.File directory, boolean bMsging) throws SolverException { super(simTask, directory, bMsging); } diff --git a/vcell-core/src/main/java/org/vcell/solver/smoldyn/SmoldynSurfaceTessellator.java b/vcell-core/src/main/java/org/vcell/solver/smoldyn/SmoldynSurfaceTessellator.java index eb5f84fc4d..b8f97969a0 100644 --- a/vcell-core/src/main/java/org/vcell/solver/smoldyn/SmoldynSurfaceTessellator.java +++ b/vcell-core/src/main/java/org/vcell/solver/smoldyn/SmoldynSurfaceTessellator.java @@ -43,11 +43,11 @@ import cbit.vcell.math.MembraneSubDomain; import cbit.vcell.math.ParticleProperties.ParticleInitialConditionCount; import cbit.vcell.math.ParticleVariable; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.model.common.VCellErrorMessages; import cbit.vcell.parser.ExpressionException; import cbit.vcell.render.Vect3d; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; import cbit.vcell.solver.SolverException; import cbit.vcell.solver.server.SolverFileWriter; import cbit.vcell.solvers.MembraneElement; @@ -167,7 +167,7 @@ else if (ds == currentNodeDistanceSquared ){ } } - public SmoldynSurfaceTessellator(PrintWriter pw, SimulationTask simTask, boolean messaging) { + public SmoldynSurfaceTessellator(PrintWriter pw, StandardSimulationTask simTask, boolean messaging) { super(pw, simTask, messaging); simulation = simTask.getSimulation(); mathDesc = simulation.getMathDescription(); diff --git a/vcell-core/src/main/java/org/vcell/solver/smoldyn/SphereTestFixture.java b/vcell-core/src/main/java/org/vcell/solver/smoldyn/SphereTestFixture.java index bebdfa718e..ac7845a6a0 100644 --- a/vcell-core/src/main/java/org/vcell/solver/smoldyn/SphereTestFixture.java +++ b/vcell-core/src/main/java/org/vcell/solver/smoldyn/SphereTestFixture.java @@ -15,7 +15,7 @@ import cbit.vcell.geometry.surface.IcoSphere; import cbit.vcell.geometry.surface.Polygon; import cbit.vcell.geometry.surface.Triangle; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; /** * class to replace Virtual Cell tessellation of surface with spherical. diff --git a/vcell-core/src/main/java/org/vcell/util/document/DocumentValidUtil.java b/vcell-core/src/main/java/org/vcell/util/document/DocumentValidUtil.java index b3587e61cd..98d0476a45 100644 --- a/vcell-core/src/main/java/org/vcell/util/document/DocumentValidUtil.java +++ b/vcell-core/src/main/java/org/vcell/util/document/DocumentValidUtil.java @@ -9,7 +9,7 @@ import cbit.vcell.biomodel.BioModel; import cbit.vcell.mapping.SimulationContext; import cbit.vcell.solver.OutputFunctionContext.OutputFunctionIssueSource; -import cbit.vcell.solver.SimulationOwner; +import cbit.vcell.solver.simulation.SimulationOwner; public class DocumentValidUtil { diff --git a/vcell-core/src/main/java/org/vcell/util/document/VersionableType.java b/vcell-core/src/main/java/org/vcell/util/document/VersionableType.java index d399c354ef..3ac56fdb95 100644 --- a/vcell-core/src/main/java/org/vcell/util/document/VersionableType.java +++ b/vcell-core/src/main/java/org/vcell/util/document/VersionableType.java @@ -25,7 +25,7 @@ public class VersionableType implements java.io.Serializable { public static final VersionableType MathDescription = new VersionableType(2,"MathDescription", "cbit.vcell.math.MathDescription",false); public static final VersionableType Model = new VersionableType(3,"Physiology", "cbit.vcell.model.Model",false); public static final VersionableType SimulationContext = new VersionableType(5,"SimulationSpecification", "cbit.vcell.mapping.SimulationContext",false); - public static final VersionableType Simulation = new VersionableType(6,"Simulation", "cbit.vcell.solver.Simulation",false); + public static final VersionableType Simulation = new VersionableType(6,"Simulation", "cbit.vcell.solver.simulation.Simulation",false); public static final VersionableType BioModelMetaData = new VersionableType(7,"BioModel", "cbit.vcell.biomodel.BioModelMetaData",true); public static final VersionableType MathModelMetaData = new VersionableType(8,"MathModel", "cbit.vcell.mathmodel.MathModelMetaData",true); /** diff --git a/vcell-core/src/main/java/org/vcell/vis/io/ChomboFiles.java b/vcell-core/src/main/java/org/vcell/vis/io/ChomboFiles.java index f791517c43..cab4ad224f 100644 --- a/vcell-core/src/main/java/org/vcell/vis/io/ChomboFiles.java +++ b/vcell-core/src/main/java/org/vcell/vis/io/ChomboFiles.java @@ -7,7 +7,7 @@ import org.vcell.util.document.KeyValue; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; public class ChomboFiles { diff --git a/vcell-core/src/main/java/org/vcell/vis/io/ComsolSimFiles.java b/vcell-core/src/main/java/org/vcell/vis/io/ComsolSimFiles.java index 4fdafebd82..9c68e017bc 100644 --- a/vcell-core/src/main/java/org/vcell/vis/io/ComsolSimFiles.java +++ b/vcell-core/src/main/java/org/vcell/vis/io/ComsolSimFiles.java @@ -4,7 +4,7 @@ import org.vcell.util.document.KeyValue; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; public class ComsolSimFiles { diff --git a/vcell-core/src/main/java/org/vcell/vis/io/MovingBoundarySimFiles.java b/vcell-core/src/main/java/org/vcell/vis/io/MovingBoundarySimFiles.java index b3a2983be2..2e507982a4 100644 --- a/vcell-core/src/main/java/org/vcell/vis/io/MovingBoundarySimFiles.java +++ b/vcell-core/src/main/java/org/vcell/vis/io/MovingBoundarySimFiles.java @@ -4,7 +4,7 @@ import org.vcell.util.document.KeyValue; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; public class MovingBoundarySimFiles { diff --git a/vcell-core/src/main/java/org/vcell/vis/io/VCellSimFiles.java b/vcell-core/src/main/java/org/vcell/vis/io/VCellSimFiles.java index cc8aefc1ff..3f38dcd5e2 100644 --- a/vcell-core/src/main/java/org/vcell/vis/io/VCellSimFiles.java +++ b/vcell-core/src/main/java/org/vcell/vis/io/VCellSimFiles.java @@ -7,7 +7,7 @@ import org.vcell.util.document.KeyValue; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; public class VCellSimFiles { diff --git a/vcell-core/src/main/java/org/vcell/vmicro/workflow/data/CurveFitting.java b/vcell-core/src/main/java/org/vcell/vmicro/workflow/data/CurveFitting.java index a786ce87d0..d2e930b2f5 100644 --- a/vcell-core/src/main/java/org/vcell/vmicro/workflow/data/CurveFitting.java +++ b/vcell-core/src/main/java/org/vcell/vmicro/workflow/data/CurveFitting.java @@ -29,7 +29,7 @@ import cbit.vcell.opt.Weights; import cbit.vcell.opt.solvers.PowellOptimizationSolver; import cbit.vcell.parser.ExpressionException; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; /** * Fitting utilities */ diff --git a/vcell-core/src/main/java/org/vcell/vmicro/workflow/data/ROIDataGenerator.java b/vcell-core/src/main/java/org/vcell/vmicro/workflow/data/ROIDataGenerator.java index 136d4237f5..5f7d740ee8 100644 --- a/vcell-core/src/main/java/org/vcell/vmicro/workflow/data/ROIDataGenerator.java +++ b/vcell-core/src/main/java/org/vcell/vmicro/workflow/data/ROIDataGenerator.java @@ -22,8 +22,8 @@ import cbit.vcell.simdata.DataSetControllerImpl; import cbit.vcell.simdata.SimDataBlock; import cbit.vcell.simdata.SimulationData; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationJob; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationJob; import cbit.vcell.solvers.CartesianMesh; @SuppressWarnings("serial") diff --git a/vcell-core/src/test/java/cbit/image/VCImageTest.java b/vcell-core/src/test/java/cbit/image/VCImageTest.java index 0c3db1d178..4e33f04688 100644 --- a/vcell-core/src/test/java/cbit/image/VCImageTest.java +++ b/vcell-core/src/test/java/cbit/image/VCImageTest.java @@ -6,7 +6,7 @@ import cbit.vcell.mapping.SimulationContext; import cbit.vcell.math.MathCompareResults; import cbit.vcell.math.MathDescription; -import cbit.vcell.solver.SimulationSymbolTable; +import cbit.vcell.solver.simulation.SimulationSymbolTable; import cbit.vcell.xml.XmlHelper; import cbit.vcell.xml.XmlParseException; import org.junit.jupiter.api.Assertions; diff --git a/vcell-core/src/test/java/cbit/vcell/biomodel/BioModelTest.java b/vcell-core/src/test/java/cbit/vcell/biomodel/BioModelTest.java index 1260204617..f641942fee 100644 --- a/vcell-core/src/test/java/cbit/vcell/biomodel/BioModelTest.java +++ b/vcell-core/src/test/java/cbit/vcell/biomodel/BioModelTest.java @@ -17,7 +17,7 @@ import cbit.vcell.model.ModelTest; import cbit.vcell.model.Structure; import cbit.vcell.parser.Expression; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; /** * Insert the type's description here. * Creation date: (11/14/00 5:56:27 PM) diff --git a/vcell-core/src/test/java/cbit/vcell/biomodel/MathOverrideApplyTest.java b/vcell-core/src/test/java/cbit/vcell/biomodel/MathOverrideApplyTest.java index 0ad8150df6..edbc336120 100644 --- a/vcell-core/src/test/java/cbit/vcell/biomodel/MathOverrideApplyTest.java +++ b/vcell-core/src/test/java/cbit/vcell/biomodel/MathOverrideApplyTest.java @@ -3,7 +3,7 @@ import cbit.vcell.mapping.SimulationContext; import cbit.vcell.resource.NativeLib; import cbit.vcell.resource.PropertyLoader; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; import cbit.vcell.xml.XMLSource; import cbit.vcell.xml.XmlHelper; import cbit.vcell.xml.XmlParseException; diff --git a/vcell-core/src/test/java/cbit/vcell/biomodel/ModelCountAndConcentrationTest.java b/vcell-core/src/test/java/cbit/vcell/biomodel/ModelCountAndConcentrationTest.java index 175a169475..b8463717f4 100644 --- a/vcell-core/src/test/java/cbit/vcell/biomodel/ModelCountAndConcentrationTest.java +++ b/vcell-core/src/test/java/cbit/vcell/biomodel/ModelCountAndConcentrationTest.java @@ -10,8 +10,8 @@ import cbit.vcell.matrix.MatrixException; import cbit.vcell.model.ModelException; import cbit.vcell.parser.ExpressionException; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationSymbolTable; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationSymbolTable; import cbit.vcell.xml.XMLSource; import cbit.vcell.xml.XmlHelper; import cbit.vcell.xml.XmlParseException; diff --git a/vcell-core/src/test/java/cbit/vcell/biomodel/ModelUnitConverterTest.java b/vcell-core/src/test/java/cbit/vcell/biomodel/ModelUnitConverterTest.java index bf7b8c6f7c..219dd9a57a 100644 --- a/vcell-core/src/test/java/cbit/vcell/biomodel/ModelUnitConverterTest.java +++ b/vcell-core/src/test/java/cbit/vcell/biomodel/ModelUnitConverterTest.java @@ -14,8 +14,8 @@ import cbit.vcell.parser.Expression; import cbit.vcell.parser.ExpressionException; import cbit.vcell.solver.MathOverrides; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationSymbolTable; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationSymbolTable; import cbit.vcell.units.VCUnitDefinition; import cbit.vcell.units.VCUnitSystem; import cbit.vcell.xml.XMLSource; diff --git a/vcell-core/src/test/java/cbit/vcell/biomodel/SpringSaLaDGoodReactionsTest.java b/vcell-core/src/test/java/cbit/vcell/biomodel/SpringSaLaDGoodReactionsTest.java index 4e800a1f58..599678df68 100644 --- a/vcell-core/src/test/java/cbit/vcell/biomodel/SpringSaLaDGoodReactionsTest.java +++ b/vcell-core/src/test/java/cbit/vcell/biomodel/SpringSaLaDGoodReactionsTest.java @@ -6,7 +6,7 @@ import cbit.vcell.mapping.SimulationContext.Application; import cbit.vcell.math.*; import cbit.vcell.mathmodel.MathModel; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.model.ReactionRule; import cbit.vcell.model.SpeciesContext; import cbit.vcell.model.Structure; @@ -16,6 +16,8 @@ import cbit.vcell.solver.*; import cbit.vcell.solver.server.Solver; import cbit.vcell.solver.server.SolverFactory; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationJob; import cbit.vcell.xml.XMLSource; import cbit.vcell.xml.XmlHelper; import cbit.vcell.xml.XmlParseException; @@ -243,7 +245,7 @@ public void test_springsalad_simple_simulation() throws IOException, XmlParseExc File localSimDataDir = ResourceUtil.getLocalSimDir(User.tempUser.getName()); SimulationJob simJob = new SimulationJob(simulation, 0, null); - SimulationTask simTask = new SimulationTask(simJob, 0); + StandardSimulationTask simTask = new StandardSimulationTask(simJob, 0); SolverDescription solverDescription = simTask.getSimulation().getSolverTaskDescription().getSolverDescription(); diff --git a/vcell-core/src/test/java/cbit/vcell/mapping/MathGenCompareTest.java b/vcell-core/src/test/java/cbit/vcell/mapping/MathGenCompareTest.java index f519c6f8ef..2c349f8d2a 100644 --- a/vcell-core/src/test/java/cbit/vcell/mapping/MathGenCompareTest.java +++ b/vcell-core/src/test/java/cbit/vcell/mapping/MathGenCompareTest.java @@ -6,7 +6,7 @@ import cbit.vcell.math.MathDescription; import cbit.vcell.resource.NativeLib; import cbit.vcell.resource.PropertyLoader; -import cbit.vcell.solver.SimulationSymbolTable; +import cbit.vcell.solver.simulation.SimulationSymbolTable; import cbit.vcell.xml.XMLSource; import cbit.vcell.xml.XmlHelper; import cbit.vcell.xml.XmlParseException; diff --git a/vcell-core/src/test/java/cbit/vcell/solvers/TestAllAbstractSolvers.java b/vcell-core/src/test/java/cbit/vcell/solvers/TestAllAbstractSolvers.java new file mode 100644 index 0000000000..a6d76bf7ab --- /dev/null +++ b/vcell-core/src/test/java/cbit/vcell/solvers/TestAllAbstractSolvers.java @@ -0,0 +1,5 @@ +package cbit.vcell.solvers; + +public class TestAllAbstractSolvers { + +} diff --git a/vcell-core/src/test/java/org/vcell/sbml/SBMLSolver.java b/vcell-core/src/test/java/org/vcell/sbml/SBMLSolver.java index fac65eb89f..f976397ffc 100644 --- a/vcell-core/src/test/java/org/vcell/sbml/SBMLSolver.java +++ b/vcell-core/src/test/java/org/vcell/sbml/SBMLSolver.java @@ -2,13 +2,15 @@ import cbit.vcell.field.FieldDataIdentifierSpec; import cbit.vcell.mapping.SimulationContext; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.parser.ExpressionException; import cbit.vcell.solver.*; import cbit.vcell.solver.ode.ODESolver; import cbit.vcell.solver.ode.ODESolverResultSet; import cbit.vcell.solver.server.SolverFactory; import cbit.vcell.solver.server.SolverStatus; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationJob; import cbit.vcell.solver.stoch.GibsonSolver; import cbit.vcell.solver.stoch.HybridSolver; import cbit.vcell.solvers.AbstractCompiledSolver; @@ -44,7 +46,7 @@ public SBMLResults simulate(File workingDir, tempSimulation.setSimulationOwner(simulation.getSimulationOwner()); TempSimulationJob tempSimulationJob = new TempSimulationJob(tempSimulation, 0, null); - SimulationTask simTask = new SimulationTask(tempSimulationJob, 0); + StandardSimulationTask simTask = new StandardSimulationTask(tempSimulationJob, 0); AbstractCompiledSolver solver = (AbstractCompiledSolver) SolverFactory.createSolver(workingDir, simTask, false); solver.runSolver(); diff --git a/vcell-core/src/test/java/org/vcell/sbml/SBMLTestSuiteTest.java b/vcell-core/src/test/java/org/vcell/sbml/SBMLTestSuiteTest.java index 439fa4a32e..90267339a4 100644 --- a/vcell-core/src/test/java/org/vcell/sbml/SBMLTestSuiteTest.java +++ b/vcell-core/src/test/java/org/vcell/sbml/SBMLTestSuiteTest.java @@ -9,7 +9,7 @@ import cbit.vcell.resource.PropertyLoader; import cbit.vcell.solver.ErrorTolerance; import cbit.vcell.solver.ExplicitOutputTimeSpec; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; import cbit.vcell.solver.TimeBounds; import org.apache.log4j.ConsoleAppender; import org.apache.log4j.Logger; diff --git a/vcell-core/src/test/java/org/vcell/sbml/SEDMLExporterCommon.java b/vcell-core/src/test/java/org/vcell/sbml/SEDMLExporterCommon.java index 4e3431da3d..f4c9266b42 100644 --- a/vcell-core/src/test/java/org/vcell/sbml/SEDMLExporterCommon.java +++ b/vcell-core/src/test/java/org/vcell/sbml/SEDMLExporterCommon.java @@ -8,8 +8,8 @@ import cbit.vcell.math.MathDescription; import cbit.vcell.resource.NativeLib; import cbit.vcell.resource.PropertyLoader; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationSymbolTable; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationSymbolTable; import cbit.vcell.solver.SolverDescription; import cbit.vcell.xml.XMLSource; import cbit.vcell.xml.XmlHelper; diff --git a/vcell-core/src/test/java/org/vcell/sbml/StructureSizeSolverTest.java b/vcell-core/src/test/java/org/vcell/sbml/StructureSizeSolverTest.java index 1c00e36535..718a92f950 100644 --- a/vcell-core/src/test/java/org/vcell/sbml/StructureSizeSolverTest.java +++ b/vcell-core/src/test/java/org/vcell/sbml/StructureSizeSolverTest.java @@ -10,7 +10,7 @@ import cbit.vcell.model.Model; import cbit.vcell.model.Structure; import cbit.vcell.parser.*; -import cbit.vcell.solver.SimulationSymbolTable; +import cbit.vcell.solver.simulation.SimulationSymbolTable; import cbit.vcell.xml.XMLSource; import cbit.vcell.xml.XmlHelper; import cbit.vcell.xml.XmlParseException; diff --git a/vcell-core/src/test/java/org/vcell/sedml/StandaloneSEDMLTest.java b/vcell-core/src/test/java/org/vcell/sedml/StandaloneSEDMLTest.java index fda9b4ea22..26f34e19db 100644 --- a/vcell-core/src/test/java/org/vcell/sedml/StandaloneSEDMLTest.java +++ b/vcell-core/src/test/java/org/vcell/sedml/StandaloneSEDMLTest.java @@ -35,8 +35,7 @@ import cbit.vcell.mapping.SimulationContext.Application; import cbit.vcell.mapping.SimulationContext.MathMappingCallback; import cbit.vcell.mapping.SimulationContext.NetworkGenerationRequirements; -import cbit.vcell.resource.ResourceUtil; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; import cbit.vcell.solver.SolverDescription; import cbit.vcell.xml.XMLSource; import cbit.vcell.xml.XmlHelper; diff --git a/vcell-server/src/main/java/cbit/vcell/message/server/batch/sim/AvgStochMultiTrial.java b/vcell-server/src/main/java/cbit/vcell/message/server/batch/sim/AvgStochMultiTrial.java index a6e483f5aa..ff24db02ca 100644 --- a/vcell-server/src/main/java/cbit/vcell/message/server/batch/sim/AvgStochMultiTrial.java +++ b/vcell-server/src/main/java/cbit/vcell/message/server/batch/sim/AvgStochMultiTrial.java @@ -9,7 +9,7 @@ import org.apache.commons.io.FileUtils; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.resource.ResourceUtil; import cbit.vcell.simdata.PortableCommand; import cbit.vcell.simdata.SimDataConstants; @@ -34,7 +34,7 @@ public AvgStochMultiTrial(String primaryUserDirInternal, String xmlSimTask) { @Override public int execute() { try { - SimulationTask simTask = XmlHelper.XMLToSimTask(xmlSimTask); + StandardSimulationTask simTask = XmlHelper.XMLToSimTask(xmlSimTask); String s = avgAll(simTask, new File(primaryUserDirInternal)); String allAvgIDA = ResourceUtil.forceUnixPath(new File(primaryUserDirInternal ,simTask.getSimulationJobID()+SimDataConstants.IDA_DATA_EXTENSION).toString()); FileUtils.write(new File(allAvgIDA), s, Charset.forName(StandardCharsets.UTF_8.name())); @@ -50,7 +50,7 @@ public Exception exception() { return exc; } - public static String avgAll(SimulationTask simTask, File primaryUserDirInternal) throws Exception{ + public static String avgAll(StandardSimulationTask simTask, File primaryUserDirInternal) throws Exception{ String idaSlurmRoot = simTask.getSimulationJobID()+SimDataConstants.IDA_DATA_EXTENSION; Exception lastError = null; int doCnt = 0; diff --git a/vcell-server/src/main/java/cbit/vcell/message/server/batch/sim/HtcSimulationWorker.java b/vcell-server/src/main/java/cbit/vcell/message/server/batch/sim/HtcSimulationWorker.java index 1229185e8e..7fbd0adb96 100644 --- a/vcell-server/src/main/java/cbit/vcell/message/server/batch/sim/HtcSimulationWorker.java +++ b/vcell-server/src/main/java/cbit/vcell/message/server/batch/sim/HtcSimulationWorker.java @@ -23,7 +23,7 @@ import cbit.vcell.message.server.cmd.CommandService.CommandOutput; import cbit.vcell.message.server.htc.HtcProxy; import cbit.vcell.message.server.htc.slurm.SlurmProxy; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.resource.OperatingSystemInfo; import cbit.vcell.resource.PropertyLoader; import cbit.vcell.resource.ResourceUtil; @@ -184,7 +184,7 @@ public String toString() { * @param simTask * @return PostProcessingChores */ -private PostProcessingChores choresFor(SimulationTask simTask) { +private PostProcessingChores choresFor(StandardSimulationTask simTask) { String userDir = "/" + simTask.getUserName(); String primaryInternal = PropertyLoader.getRequiredProperty(PropertyLoader.primarySimDataDirInternalProperty); String primaryExternal = PropertyLoader.getRequiredProperty(PropertyLoader.primarySimDataDirExternalProperty); @@ -283,7 +283,7 @@ private static Hashtable getMonitorJobs(){ lg.info("removed "+theseJobsAreDone.size()+" jobs, left with "+result.size()); return result; } -private void addMonitorJob(long slurmJobID,SimulationTask simTask,boolean bDelete) { +private void addMonitorJob(long slurmJobID, StandardSimulationTask simTask, boolean bDelete) { try { MonitorJobInfo newJobInfo = null; if(bDelete) { @@ -446,7 +446,7 @@ private void initQueueConsumer() { @Override public void onQueueMessage(VCMessage vcMessage, VCMessageSession session) throws RollbackException { - SimulationTask simTask = null; + StandardSimulationTask simTask = null; try { SimulationTaskMessage simTaskMessage = new SimulationTaskMessage(vcMessage); simTask = simTaskMessage.getSimulationTask(); @@ -500,7 +500,7 @@ public void onQueueMessage(VCMessage vcMessage, VCMessageSession session) throws vcMessagingService_int.addMessageConsumer(queueConsumer); } -private HtcJobID submit2PBS(SimulationTask simTask, HtcProxy clonedHtcProxy, PostProcessingChores chores) throws XmlParseException, IOException, SolverException, ExecutableException { +private HtcJobID submit2PBS(StandardSimulationTask simTask, HtcProxy clonedHtcProxy, PostProcessingChores chores) throws XmlParseException, IOException, SolverException, ExecutableException { HtcJobID jobid = null; File htcLogDirExternal = new File(PropertyLoader.getRequiredProperty(PropertyLoader.htcLogDirExternal)); diff --git a/vcell-server/src/main/java/cbit/vcell/message/server/batch/sim/JavaSimulationExecutable.java b/vcell-server/src/main/java/cbit/vcell/message/server/batch/sim/JavaSimulationExecutable.java index e603c0c051..ac2137d0f0 100644 --- a/vcell-server/src/main/java/cbit/vcell/message/server/batch/sim/JavaSimulationExecutable.java +++ b/vcell-server/src/main/java/cbit/vcell/message/server/batch/sim/JavaSimulationExecutable.java @@ -17,7 +17,7 @@ import cbit.vcell.message.messages.WorkerEventMessage; import cbit.vcell.message.server.ManageUtils; import cbit.vcell.message.server.ServerMessagingDelegate; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.mongodb.VCMongoMessage; import cbit.vcell.resource.PropertyLoader; import cbit.vcell.solver.SolverException; @@ -37,7 +37,7 @@ public class JavaSimulationExecutable { String[] arguments = null; private boolean bProgress = true; - private SimulationTask simulationTask = null; + private StandardSimulationTask simulationTask = null; private Solver solver = null; private long lastMsgTimeStamp = 0; diff --git a/vcell-server/src/main/java/cbit/vcell/message/server/batch/sim/SolverPreprocessor.java b/vcell-server/src/main/java/cbit/vcell/message/server/batch/sim/SolverPreprocessor.java index 414d4058c0..7cff2c28c6 100644 --- a/vcell-server/src/main/java/cbit/vcell/message/server/batch/sim/SolverPreprocessor.java +++ b/vcell-server/src/main/java/cbit/vcell/message/server/batch/sim/SolverPreprocessor.java @@ -16,13 +16,13 @@ import cbit.vcell.message.jms.activeMQ.VCMessagingServiceActiveMQ; import cbit.vcell.message.messages.WorkerEventMessage; import cbit.vcell.message.server.ServerMessagingDelegate; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.mongodb.VCMongoMessage; import cbit.vcell.mongodb.VCMongoMessage.ServiceName; import cbit.vcell.resource.PropertyLoader; import cbit.vcell.simdata.SimulationData; import cbit.vcell.simdata.SimulationData.SimDataAmplistorInfo; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; import cbit.vcell.solver.server.SimulationMessage; import cbit.vcell.solver.server.SolverEvent; import cbit.vcell.solver.server.SolverListener; @@ -53,7 +53,7 @@ public class SolverPreprocessor { * @param args an array of command-line arguments * @throws VCMessagingException */ - public static void sendFailureAndExit(HTCSolver htcSolver, SimulationTask simTask, String hostName, SimulationMessage simMessage) throws VCMessagingException{ + public static void sendFailureAndExit(HTCSolver htcSolver, StandardSimulationTask simTask, String hostName, SimulationMessage simMessage) throws VCMessagingException{ VCMessagingService service = new VCMessagingServiceActiveMQ(); String jmshost = PropertyLoader.getRequiredProperty(PropertyLoader.jmsSimHostInternal); int jmsport = Integer.parseInt(PropertyLoader.getRequiredProperty(PropertyLoader.jmsSimPortInternal)); @@ -99,7 +99,7 @@ public static void main(java.lang.String[] args) { // File simulationFile = new File(args[0]); - final SimulationTask simTask = XmlHelper.XMLToSimTask(FileUtils.readFileToString(simulationFile)); + final StandardSimulationTask simTask = XmlHelper.XMLToSimTask(FileUtils.readFileToString(simulationFile)); if (parallelDirectory != null){ // simulation task needs to be written to the "parallel directory" (a temporary directory) here (it is local to the cluster). FileUtils.copyFile(simulationFile, new File(parallelDirectory,simulationFile.getName())); @@ -222,7 +222,7 @@ public boolean accept(String fileName) { } - private static void recoverLastSimulationData(SimulationTask simTask,File userDir, Logger lg){ + private static void recoverLastSimulationData(StandardSimulationTask simTask, File userDir, Logger lg){ SimulationData.SimDataAmplistorInfo simDataAmplistorInfo = AmplistorUtils.getSimDataAmplistorInfoFromPropertyLoader(); if(simDataAmplistorInfo != null){ try{ diff --git a/vcell-server/src/main/java/cbit/vcell/message/server/bootstrap/LocalSimulationController.java b/vcell-server/src/main/java/cbit/vcell/message/server/bootstrap/LocalSimulationController.java index 0a39899a64..196bff6dfc 100644 --- a/vcell-server/src/main/java/cbit/vcell/message/server/bootstrap/LocalSimulationController.java +++ b/vcell-server/src/main/java/cbit/vcell/message/server/bootstrap/LocalSimulationController.java @@ -20,7 +20,7 @@ import cbit.vcell.server.SimpleJobStatusQuerySpec; import cbit.vcell.server.SimulationController; import cbit.vcell.server.SimulationStatus; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; import cbit.vcell.solver.VCSimulationIdentifier; /** * Insert the type's description here. diff --git a/vcell-server/src/main/java/cbit/vcell/message/server/bootstrap/SimulationControllerImpl.java b/vcell-server/src/main/java/cbit/vcell/message/server/bootstrap/SimulationControllerImpl.java index 50a64da3d0..38daebdc8b 100644 --- a/vcell-server/src/main/java/cbit/vcell/message/server/bootstrap/SimulationControllerImpl.java +++ b/vcell-server/src/main/java/cbit/vcell/message/server/bootstrap/SimulationControllerImpl.java @@ -43,7 +43,7 @@ import cbit.vcell.message.messages.SimulationTaskMessage; import cbit.vcell.message.server.dispatcher.SimulationDatabase; import cbit.vcell.message.server.dispatcher.SimulationDispatcherEngine; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.resource.PropertyLoader; import cbit.vcell.server.SimpleJobStatus; import cbit.vcell.server.SimpleJobStatusQuerySpec; @@ -51,8 +51,8 @@ import cbit.vcell.server.SimulationJobStatus.SchedulerStatus; import cbit.vcell.server.SimulationStatus; import cbit.vcell.server.SimulationTaskID; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationInfo; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationInfo; import cbit.vcell.solver.SolverException; import cbit.vcell.solver.VCSimulationIdentifier; import cbit.vcell.solver.server.SimulationMessage; @@ -116,7 +116,7 @@ public SimulationDatabase getSimulationDatabase(){ * Insert the method's description here. * Creation date: (6/28/01 1:19:54 PM) * @return cbit.vcell.solvers.SolverController - * @param simulation cbit.vcell.solver.Simulation + * @param simulation cbit.vcell.solver.simulation.Simulation * @throws RemoteException * @throws JMSException * @throws AuthenticationException @@ -126,7 +126,7 @@ public SimulationDatabase getSimulationDatabase(){ * @throws SolverException * @throws ConfigurationException */ -private LocalSolverController createNewSolverController(SimulationTask simTask) throws FileNotFoundException, DataAccessException, AuthenticationException, SQLException, ConfigurationException, SolverException { +private LocalSolverController createNewSolverController(StandardSimulationTask simTask) throws FileNotFoundException, DataAccessException, AuthenticationException, SQLException, ConfigurationException, SolverException { // // either no appropriate slave server or THIS IS A SLAVE SERVER (can't pass the buck). // @@ -173,7 +173,7 @@ protected void fireSimulationJobStatusEvent(SimulationJobStatusEvent event) { * @throws SQLException * @throws FileNotFoundException */ -LocalSolverController getOrCreateSolverController(SimulationTask simTask) throws FileNotFoundException, ConfigurationException, DataAccessException, AuthenticationException, SQLException, SolverException { +LocalSolverController getOrCreateSolverController(StandardSimulationTask simTask) throws FileNotFoundException, ConfigurationException, DataAccessException, AuthenticationException, SQLException, SolverException { Simulation simulation = simTask.getSimulation(); VCSimulationIdentifier vcSimID = simulation.getSimulationInfo().getAuthoritativeVCSimulationIdentifier(); if (vcSimID == null){ @@ -263,7 +263,7 @@ public void removeSimulationJobStatusListener(SimulationJobStatusListener listen } private void onSimJobQueue_SimulationTask(VCMessage vcMessage) { - SimulationTask simTask = null; + StandardSimulationTask simTask = null; try { SimulationTaskMessage simTaskMessage = new SimulationTaskMessage(vcMessage); diff --git a/vcell-server/src/main/java/cbit/vcell/message/server/dispatcher/SimulationDatabase.java b/vcell-server/src/main/java/cbit/vcell/message/server/dispatcher/SimulationDatabase.java index 81e65363be..f915a4f5ba 100644 --- a/vcell-server/src/main/java/cbit/vcell/message/server/dispatcher/SimulationDatabase.java +++ b/vcell-server/src/main/java/cbit/vcell/message/server/dispatcher/SimulationDatabase.java @@ -20,8 +20,8 @@ import cbit.vcell.server.SimulationStatus; import cbit.vcell.server.StateInfo; import cbit.vcell.server.UpdateSynchronizationException; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationInfo; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationInfo; public interface SimulationDatabase { diff --git a/vcell-server/src/main/java/cbit/vcell/message/server/dispatcher/SimulationDatabaseDirect.java b/vcell-server/src/main/java/cbit/vcell/message/server/dispatcher/SimulationDatabaseDirect.java index 47f0e67838..841c29e919 100644 --- a/vcell-server/src/main/java/cbit/vcell/message/server/dispatcher/SimulationDatabaseDirect.java +++ b/vcell-server/src/main/java/cbit/vcell/message/server/dispatcher/SimulationDatabaseDirect.java @@ -13,7 +13,6 @@ import java.util.Vector; import java.util.concurrent.TimeUnit; -import cbit.vcell.modeldb.BioModelDbDriver; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.vcell.util.BigString; @@ -50,8 +49,8 @@ import cbit.vcell.server.SimulationStatusPersistent; import cbit.vcell.server.StateInfo; import cbit.vcell.server.UpdateSynchronizationException; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationInfo; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationInfo; import cbit.vcell.solver.VCSimulationIdentifier; import cbit.vcell.solver.server.SimulationMessage; import cbit.vcell.solver.server.SimulationMessagePersistent; diff --git a/vcell-server/src/main/java/cbit/vcell/message/server/dispatcher/SimulationDispatcher.java b/vcell-server/src/main/java/cbit/vcell/message/server/dispatcher/SimulationDispatcher.java index f717b0a81e..9e384cc5b2 100644 --- a/vcell-server/src/main/java/cbit/vcell/message/server/dispatcher/SimulationDispatcher.java +++ b/vcell-server/src/main/java/cbit/vcell/message/server/dispatcher/SimulationDispatcher.java @@ -33,7 +33,7 @@ import cbit.vcell.resource.PropertyLoader; import cbit.vcell.server.*; import cbit.vcell.server.SimulationJobStatus.SchedulerStatus; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; import cbit.vcell.solver.VCSimulationIdentifier; import com.google.gson.Gson; import com.google.inject.Guice; diff --git a/vcell-server/src/main/java/cbit/vcell/message/server/dispatcher/SimulationDispatcherEngine.java b/vcell-server/src/main/java/cbit/vcell/message/server/dispatcher/SimulationDispatcherEngine.java index 7ee67d4c84..99cafd8cd0 100644 --- a/vcell-server/src/main/java/cbit/vcell/message/server/dispatcher/SimulationDispatcherEngine.java +++ b/vcell-server/src/main/java/cbit/vcell/message/server/dispatcher/SimulationDispatcherEngine.java @@ -29,8 +29,8 @@ import cbit.vcell.server.SimulationJobStatus; import cbit.vcell.server.SimulationJobStatus.SchedulerStatus; import cbit.vcell.server.UpdateSynchronizationException; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationInfo; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationInfo; import cbit.vcell.solver.VCSimulationIdentifier; import cbit.vcell.solver.server.SimulationMessage; diff --git a/vcell-server/src/main/java/cbit/vcell/message/server/dispatcher/SimulationStateMachine.java b/vcell-server/src/main/java/cbit/vcell/message/server/dispatcher/SimulationStateMachine.java index 3df01647e5..8e960426d0 100644 --- a/vcell-server/src/main/java/cbit/vcell/message/server/dispatcher/SimulationStateMachine.java +++ b/vcell-server/src/main/java/cbit/vcell/message/server/dispatcher/SimulationStateMachine.java @@ -24,7 +24,7 @@ import cbit.vcell.message.messages.WorkerEventMessage; import cbit.vcell.message.server.htc.HtcProxy; import cbit.vcell.message.server.htc.HtcProxy.MemLimitResults; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.mongodb.VCMongoMessage; import cbit.vcell.server.HtcJobID; import cbit.vcell.server.RunningStateInfo; @@ -34,8 +34,8 @@ import cbit.vcell.server.SimulationQueueEntryStatus; import cbit.vcell.server.SimulationStatus; import cbit.vcell.server.UpdateSynchronizationException; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationJob; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationJob; import cbit.vcell.solver.SolverDescription; import cbit.vcell.solver.VCSimulationDataIdentifier; import cbit.vcell.solver.VCSimulationIdentifier; @@ -480,7 +480,7 @@ public synchronized void onDispatch(Simulation simulation, SimulationJobStatus o //'powerUsers' (previously called 'special1') assigned to users by request to allow long running sims isPowerUser = isPowerUser && Arrays.asList(myUser.getMySpecials()).contains(User.SPECIAL_CLAIM.powerUsers); } - SimulationTask simulationTask = new SimulationTask(new SimulationJob(simulation, jobIndex, fieldDataIdentifierSpecs), taskID,null,isPowerUser); + StandardSimulationTask simulationTask = new StandardSimulationTask(new SimulationJob(simulation, jobIndex, fieldDataIdentifierSpecs), taskID,null,isPowerUser); double requiredMemMB = simulationTask.getEstimatedMemorySizeMB(); //SimulationStateMachine ultimately instantiated from {vcellroot}/docker/build/Dockerfile-sched-dev by way of cbit.vcell.message.server.dispatcher.SimulationDispatcher diff --git a/vcell-server/src/main/java/cbit/vcell/message/server/htc/HtcProxy.java b/vcell-server/src/main/java/cbit/vcell/message/server/htc/HtcProxy.java index e556300baa..916cd17313 100644 --- a/vcell-server/src/main/java/cbit/vcell/message/server/htc/HtcProxy.java +++ b/vcell-server/src/main/java/cbit/vcell/message/server/htc/HtcProxy.java @@ -18,12 +18,11 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.vcell.util.BeanUtils; import org.vcell.util.document.KeyValue; import org.vcell.util.exe.ExecutableException; import cbit.vcell.message.server.cmd.CommandService; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.resource.PropertyLoader; import cbit.vcell.server.HtcJobID; import cbit.vcell.simdata.PortableCommand; @@ -157,7 +156,7 @@ public HtcProxy(CommandService commandService, String htcUser){ * @throws ExecutableException */ public abstract HtcJobID submitJob(String jobName, File sub_file_internal, File sub_file_external, ExecutableCommand.Container commandSet, - int ncpus, double memSize, Collection postProcessingCommands, SimulationTask simTask,File primaryUserDirExternal) throws ExecutableException; + int ncpus, double memSize, Collection postProcessingCommands, StandardSimulationTask simTask, File primaryUserDirExternal) throws ExecutableException; public abstract HtcJobID submitOptimizationJob(String jobName, File sub_file_internal, File sub_file_external, File optProblemInputFile,File optProblemOutputFile,File optReportFile)throws ExecutableException; public abstract HtcProxy cloneThreadsafe(); diff --git a/vcell-server/src/main/java/cbit/vcell/message/server/htc/slurm/SlurmProxy.java b/vcell-server/src/main/java/cbit/vcell/message/server/htc/slurm/SlurmProxy.java index 2e5cc336f1..7a0c142587 100644 --- a/vcell-server/src/main/java/cbit/vcell/message/server/htc/slurm/SlurmProxy.java +++ b/vcell-server/src/main/java/cbit/vcell/message/server/htc/slurm/SlurmProxy.java @@ -18,7 +18,7 @@ import cbit.vcell.message.server.htc.HtcJobNotFoundException; import cbit.vcell.message.server.htc.HtcJobStatus; import cbit.vcell.message.server.htc.HtcProxy; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.resource.PropertyLoader; import cbit.vcell.server.HtcJobID; import cbit.vcell.server.HtcJobID.BatchSystemType; @@ -421,7 +421,7 @@ public String getPostProcessCommands() { } - SbatchSolverComponents generateScript(String jobName, ExecutableCommand.Container commandSet, int ncpus, double memSizeMB, Collection postProcessingCommands, SimulationTask simTask) { + SbatchSolverComponents generateScript(String jobName, ExecutableCommand.Container commandSet, int ncpus, double memSizeMB, Collection postProcessingCommands, StandardSimulationTask simTask) { final boolean isParallel = ncpus > 1; //SlurmProxy ultimately instantiated from {vcellroot}/docker/build/Dockerfile-submit-dev by way of cbit.vcell.message.server.batch.sim.HtcSimulationWorker @@ -553,8 +553,8 @@ private void callExitScript(ExecutableCommand.Container commandSet, LineStringBu } - private void sendFailMsgScript(SimulationTask simTask, LineStringBuilder lsb, String jmshost_sim_external, - String jmsport_sim_external, String jmsuser, String jmspswd) { + private void sendFailMsgScript(StandardSimulationTask simTask, LineStringBuilder lsb, String jmshost_sim_external, + String jmsport_sim_external, String jmsuser, String jmspswd) { lsb.write("#BEGIN---------SlurmProxy.generateScript():sendFailureMsg----------"); lsb.write("sendFailureMsg() {"); lsb.write(" echo ${container_prefix} " + @@ -811,7 +811,7 @@ private void slurmScriptInit(String jobName, boolean bPowerUser, MemLimitResults } @Override - public HtcJobID submitJob(String jobName, File sub_file_internal, File sub_file_external, ExecutableCommand.Container commandSet, int ncpus, double memSizeMB, Collection postProcessingCommands, SimulationTask simTask,File primaryUserDirExternal) throws ExecutableException { + public HtcJobID submitJob(String jobName, File sub_file_internal, File sub_file_external, ExecutableCommand.Container commandSet, int ncpus, double memSizeMB, Collection postProcessingCommands, StandardSimulationTask simTask, File primaryUserDirExternal) throws ExecutableException { try { if (LG.isDebugEnabled()) { LG.debug("generating local SLURM submit script for jobName="+jobName); diff --git a/vcell-server/src/main/java/cbit/vcell/messaging/db/SimulationJobDbDriver.java b/vcell-server/src/main/java/cbit/vcell/messaging/db/SimulationJobDbDriver.java index 278ceb5b13..e6168460e5 100644 --- a/vcell-server/src/main/java/cbit/vcell/messaging/db/SimulationJobDbDriver.java +++ b/vcell-server/src/main/java/cbit/vcell/messaging/db/SimulationJobDbDriver.java @@ -41,7 +41,7 @@ import cbit.vcell.server.SimulationJobStatusPersistent; import cbit.vcell.server.SimulationJobStatusPersistent.SchedulerStatus; import cbit.vcell.solver.MathOverrides; -import cbit.vcell.solver.SimulationMetadata; +import cbit.vcell.solver.simulation.SimulationMetadata; /** * Insert the type's description here. diff --git a/vcell-server/src/main/java/cbit/vcell/modeldb/DBTopLevel.java b/vcell-server/src/main/java/cbit/vcell/modeldb/DBTopLevel.java index a5b9dc5625..75c6d4a218 100644 --- a/vcell-server/src/main/java/cbit/vcell/modeldb/DBTopLevel.java +++ b/vcell-server/src/main/java/cbit/vcell/modeldb/DBTopLevel.java @@ -56,7 +56,7 @@ import cbit.vcell.numericstest.TestSuiteOPResults; import cbit.vcell.server.UserRegistrationOP; import cbit.vcell.server.UserRegistrationResults; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; /** * This type was created in VisualAge. */ diff --git a/vcell-server/src/main/java/cbit/vcell/modeldb/DatabasePolicySQL.java b/vcell-server/src/main/java/cbit/vcell/modeldb/DatabasePolicySQL.java index 8d9eb9a633..b08e7208b0 100644 --- a/vcell-server/src/main/java/cbit/vcell/modeldb/DatabasePolicySQL.java +++ b/vcell-server/src/main/java/cbit/vcell/modeldb/DatabasePolicySQL.java @@ -12,6 +12,7 @@ import java.util.Arrays; import java.util.List; +import cbit.vcell.solver.simulation.Simulation; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.vcell.db.DatabaseSyntax; @@ -77,7 +78,7 @@ public static String enforceOwnershipInsert(User user, VersionTable vTable, Obje (org.vcell.util.document.KeyValue) valueData[1], version, dbSyntax)); }else if (vTable instanceof SimulationTable) { - sb.append(((SimulationTable) vTable).getSQLValueList( (cbit.vcell.solver.Simulation) valueData[0], + sb.append(((SimulationTable) vTable).getSQLValueList( (Simulation) valueData[0], (org.vcell.util.document.KeyValue) valueData[1], version, dbSyntax)); }else if (vTable instanceof BioModelTable) { @@ -161,7 +162,7 @@ public static String enforceOwnershipSelect(User user, Field[] fields, Table[] t VC_MATH MathDescription cbit.vcell.math.MathDescription N MathModelMetaData,BioModelMetaData->SimulationContext VC_MODEL Model cbit.vcell.model.Model N BioModelMetaData VC_SIMCONTEXT SimulationContext cbit.vcell.mapping.SimulationContext N BioModelMetaData - VC_SIMULATION Simulation cbit.vcell.solver.Simulation N BioModelMetaData,MathModelMetaData + VC_SIMULATION Simulation cbit.vcell.solver.simulation.Simulation N BioModelMetaData,MathModelMetaData VC_BIOMODEL BioModelMetaData cbit.vcell.biomodel.BioModelMetaData Y - VC_MATHMODEL MathModelMetaData cbit.vcell.mathmodel.MathModelMetaData Y - diff --git a/vcell-server/src/main/java/cbit/vcell/modeldb/DatabaseServerImpl.java b/vcell-server/src/main/java/cbit/vcell/modeldb/DatabaseServerImpl.java index 3e68d251b5..37b50765de 100644 --- a/vcell-server/src/main/java/cbit/vcell/modeldb/DatabaseServerImpl.java +++ b/vcell-server/src/main/java/cbit/vcell/modeldb/DatabaseServerImpl.java @@ -12,7 +12,6 @@ import java.sql.SQLException; import java.util.List; import java.util.TreeMap; -import java.util.TreeSet; import java.util.Vector; import org.apache.logging.log4j.LogManager; @@ -48,7 +47,6 @@ import cbit.vcell.geometry.GeometryInfo; import cbit.vcell.mapping.MappingException; import cbit.vcell.mathmodel.MathModelMetaData; -import cbit.vcell.message.server.dispatcher.SimulationDatabaseDirect; import cbit.vcell.model.DBFormalSpecies; import cbit.vcell.model.DBSpecies; import cbit.vcell.model.FormalSpeciesType; @@ -66,8 +64,8 @@ import cbit.vcell.server.SimulationStatusPersistent; import cbit.vcell.server.UserRegistrationOP; import cbit.vcell.server.UserRegistrationResults; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationInfo; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationInfo; import cbit.vcell.xml.XmlHelper; import cbit.vcell.xml.XmlParseException; import cbit.vcell.xml.Xmlproducer; diff --git a/vcell-server/src/main/java/cbit/vcell/modeldb/DbDriver.java b/vcell-server/src/main/java/cbit/vcell/modeldb/DbDriver.java index dcdc0586ed..6c4a651b20 100644 --- a/vcell-server/src/main/java/cbit/vcell/modeldb/DbDriver.java +++ b/vcell-server/src/main/java/cbit/vcell/modeldb/DbDriver.java @@ -38,7 +38,6 @@ import org.vcell.db.DatabaseSyntax; import org.vcell.db.KeyFactory; import org.vcell.pub.Publication; -import org.vcell.util.BeanUtils; import org.vcell.util.CommentStringTokenizer; import org.vcell.util.DataAccessException; import org.vcell.util.DependencyException; @@ -121,7 +120,7 @@ import cbit.vcell.numericstest.TestSuiteOP; import cbit.vcell.numericstest.TestSuiteOPResults; import cbit.vcell.solver.MathOverrides; -import cbit.vcell.solver.SimulationInfo; +import cbit.vcell.solver.simulation.SimulationInfo; import cbit.vcell.solver.MathOverrides.Element; import cbit.vcell.solver.test.VariableComparisonSummary; diff --git a/vcell-server/src/main/java/cbit/vcell/modeldb/MathVerifier.java b/vcell-server/src/main/java/cbit/vcell/modeldb/MathVerifier.java index 1db5c80f46..e2de91dccf 100644 --- a/vcell-server/src/main/java/cbit/vcell/modeldb/MathVerifier.java +++ b/vcell-server/src/main/java/cbit/vcell/modeldb/MathVerifier.java @@ -26,8 +26,8 @@ import cbit.vcell.resource.PropertyLoader; import cbit.vcell.server.AdminDatabaseServer; import cbit.vcell.server.SimulationStatusPersistent; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationSymbolTable; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationSymbolTable; import cbit.vcell.xml.VCMLComparator; import cbit.vcell.xml.XMLSource; import cbit.vcell.xml.XmlHelper; diff --git a/vcell-server/src/main/java/cbit/vcell/modeldb/ServerDocumentManager.java b/vcell-server/src/main/java/cbit/vcell/modeldb/ServerDocumentManager.java index ea3a00f67a..3595536599 100644 --- a/vcell-server/src/main/java/cbit/vcell/modeldb/ServerDocumentManager.java +++ b/vcell-server/src/main/java/cbit/vcell/modeldb/ServerDocumentManager.java @@ -44,8 +44,8 @@ import cbit.vcell.model.Model; import cbit.vcell.server.SimulationStatusPersistent; import cbit.vcell.solver.AnnotatedFunction; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationSymbolTable; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationSymbolTable; import cbit.vcell.solver.VCSimulationIdentifier; import cbit.vcell.xml.XMLSource; import cbit.vcell.xml.XmlHelper; diff --git a/vcell-server/src/main/java/cbit/vcell/modeldb/SimulationDbDriver.java b/vcell-server/src/main/java/cbit/vcell/modeldb/SimulationDbDriver.java index 7849caf3ac..59d9f1b029 100644 --- a/vcell-server/src/main/java/cbit/vcell/modeldb/SimulationDbDriver.java +++ b/vcell-server/src/main/java/cbit/vcell/modeldb/SimulationDbDriver.java @@ -34,7 +34,7 @@ import cbit.sql.RecordChangedException; import cbit.sql.Table; import cbit.vcell.modeldb.DatabasePolicySQL.LeftOuterJoin; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; /** * This type was created in VisualAge. */ diff --git a/vcell-server/src/main/java/cbit/vcell/modeldb/SimulationTable.java b/vcell-server/src/main/java/cbit/vcell/modeldb/SimulationTable.java index 33fc8b02f3..54c19e8964 100644 --- a/vcell-server/src/main/java/cbit/vcell/modeldb/SimulationTable.java +++ b/vcell-server/src/main/java/cbit/vcell/modeldb/SimulationTable.java @@ -38,8 +38,8 @@ import cbit.vcell.solver.MathOverrides; import cbit.vcell.solver.MathOverrides.Element; import cbit.vcell.solver.MeshSpecification; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationInfo; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationInfo; import cbit.vcell.solver.SolverTaskDescription; /** diff --git a/vcell-server/src/main/java/cbit/vcell/modeldb/VCDatabaseScanner.java b/vcell-server/src/main/java/cbit/vcell/modeldb/VCDatabaseScanner.java index b760ddc33b..dde6e5be6c 100644 --- a/vcell-server/src/main/java/cbit/vcell/modeldb/VCDatabaseScanner.java +++ b/vcell-server/src/main/java/cbit/vcell/modeldb/VCDatabaseScanner.java @@ -8,7 +8,7 @@ import cbit.vcell.math.MathDescription; import cbit.vcell.mathmodel.MathModel; import cbit.vcell.model.BioModelVisitor; -import cbit.vcell.solver.SimulationSymbolTable; +import cbit.vcell.solver.simulation.SimulationSymbolTable; import cbit.vcell.xml.XMLSource; import cbit.vcell.xml.XmlParseException; import org.apache.logging.log4j.LogManager; diff --git a/vcell-server/src/main/java/cbit/vcell/modeldb/VersionTable.java b/vcell-server/src/main/java/cbit/vcell/modeldb/VersionTable.java index fcd91a915c..1817d0415c 100644 --- a/vcell-server/src/main/java/cbit/vcell/modeldb/VersionTable.java +++ b/vcell-server/src/main/java/cbit/vcell/modeldb/VersionTable.java @@ -37,7 +37,7 @@ import cbit.vcell.math.MathDescription; import cbit.vcell.mathmodel.MathModelMetaData; import cbit.vcell.model.Model; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; /** * This type was created in VisualAge. */ diff --git a/vcell-server/src/main/java/cbit/vcell/tools/IonItems.java b/vcell-server/src/main/java/cbit/vcell/tools/IonItems.java index 2c70fd4785..4ec88553b8 100644 --- a/vcell-server/src/main/java/cbit/vcell/tools/IonItems.java +++ b/vcell-server/src/main/java/cbit/vcell/tools/IonItems.java @@ -3,7 +3,6 @@ import java.io.BufferedReader; import java.io.File; import java.io.FileFilter; -import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.math.BigDecimal; @@ -22,8 +21,6 @@ import org.vcell.db.KeyFactory; import org.vcell.util.BeanUtils; import org.vcell.util.BigString; -import org.vcell.util.DataAccessException; -import org.vcell.util.ObjectNotFoundException; import org.vcell.util.document.GroupAccess; import org.vcell.util.document.KeyValue; import org.vcell.util.document.User; @@ -31,22 +28,16 @@ import org.vcell.util.document.VCDocument.VCDocumentType; import org.vcell.util.document.VersionFlag; -import cbit.sql.QueryHashtable; import cbit.vcell.biomodel.BioModel; -import cbit.vcell.geometry.GeometryThumbnailImageFactory; -import cbit.vcell.geometry.GeometryThumbnailImageFactoryAWT; import cbit.vcell.mathmodel.MathModel; import cbit.vcell.messaging.db.SimulationJobTable; import cbit.vcell.modeldb.BioModelSimContextLinkTable; import cbit.vcell.modeldb.BioModelSimulationLinkTable; import cbit.vcell.modeldb.BioModelTable; -import cbit.vcell.modeldb.DBTopLevel; import cbit.vcell.modeldb.DatabaseServerImpl; -import cbit.vcell.modeldb.LocalUserMetaDbServer; import cbit.vcell.modeldb.MathModelSimulationLinkTable; import cbit.vcell.modeldb.MathModelTable; import cbit.vcell.modeldb.PublicationModelLinkTable; -import cbit.vcell.modeldb.ServerDocumentManager; import cbit.vcell.modeldb.TFTestCaseTable; import cbit.vcell.modeldb.TFTestSuiteTable; import cbit.vcell.modeldb.UserTable; @@ -60,7 +51,7 @@ import cbit.vcell.simdata.SimulationData; import cbit.vcell.solver.AnnotatedFunction; import cbit.vcell.solver.OutputFunctionContext; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; import cbit.vcell.solver.VCSimulationDataIdentifier; import cbit.vcell.solver.VCSimulationIdentifier; import cbit.vcell.xml.XMLSource; diff --git a/vcell-server/src/test/java/cbit/vcell/modeldb/HybridBioModelVisitor.java b/vcell-server/src/test/java/cbit/vcell/modeldb/HybridBioModelVisitor.java index 56f8c44777..ba045b9154 100644 --- a/vcell-server/src/test/java/cbit/vcell/modeldb/HybridBioModelVisitor.java +++ b/vcell-server/src/test/java/cbit/vcell/modeldb/HybridBioModelVisitor.java @@ -3,7 +3,7 @@ import cbit.vcell.biomodel.BioModel; import cbit.vcell.mapping.SimulationContext; import cbit.vcell.mapping.SpeciesContextSpec; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; import org.vcell.util.document.User; diff --git a/vcell-vmicro/src/main/java/org/vcell/vmicro/op/Generate2DExpModelOpAbstract.java b/vcell-vmicro/src/main/java/org/vcell/vmicro/op/Generate2DExpModelOpAbstract.java index 92b5316223..ad57790baa 100644 --- a/vcell-vmicro/src/main/java/org/vcell/vmicro/op/Generate2DExpModelOpAbstract.java +++ b/vcell-vmicro/src/main/java/org/vcell/vmicro/op/Generate2DExpModelOpAbstract.java @@ -5,6 +5,8 @@ import java.util.Date; import cbit.vcell.solver.*; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationOwner; import org.vcell.util.Extent; import org.vcell.util.ISize; import org.vcell.util.Origin; diff --git a/vcell-vmicro/src/main/java/org/vcell/vmicro/op/Generate2DSimBioModelOp.java b/vcell-vmicro/src/main/java/org/vcell/vmicro/op/Generate2DSimBioModelOp.java index 0ba1ffe5c1..9ea919c159 100644 --- a/vcell-vmicro/src/main/java/org/vcell/vmicro/op/Generate2DSimBioModelOp.java +++ b/vcell-vmicro/src/main/java/org/vcell/vmicro/op/Generate2DSimBioModelOp.java @@ -5,6 +5,8 @@ import java.util.Date; import cbit.vcell.solver.*; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationOwner; import org.vcell.util.Extent; import org.vcell.util.document.GroupAccessNone; import org.vcell.util.document.KeyValue; diff --git a/vcell-vmicro/src/main/java/org/vcell/vmicro/op/RunFakeSimOp.java b/vcell-vmicro/src/main/java/org/vcell/vmicro/op/RunFakeSimOp.java index 0d7a964e07..1c32f4de26 100644 --- a/vcell-vmicro/src/main/java/org/vcell/vmicro/op/RunFakeSimOp.java +++ b/vcell-vmicro/src/main/java/org/vcell/vmicro/op/RunFakeSimOp.java @@ -17,13 +17,13 @@ import cbit.image.SourceDataInfo; import cbit.vcell.VirtualMicroscopy.UShortImage; import cbit.vcell.mapping.SimulationContext; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.simdata.DataOperation.DataProcessingOutputDataValuesOP; import cbit.vcell.simdata.DataOperation.DataProcessingOutputDataValuesOP.DataIndexHelper; import cbit.vcell.simdata.DataOperation.DataProcessingOutputDataValuesOP.TimePointHelper; import cbit.vcell.simdata.DataOperationResults.DataProcessingOutputDataValues; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationJob; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationJob; import cbit.vcell.solver.SolverUtilities; import cbit.vcell.solver.VCSimulationDataIdentifier; import cbit.vcell.solver.VCSimulationIdentifier; @@ -130,7 +130,7 @@ private static void runFVSolverStandalone( ClientTaskStatusSupport progressListener) throws Exception{ int jobIndex = 0; - SimulationTask simTask = new SimulationTask(new SimulationJob(sim,jobIndex, null),0); + StandardSimulationTask simTask = new StandardSimulationTask(new SimulationJob(sim,jobIndex, null),0); SolverUtilities.prepareSolverExecutable(sim.getSolverTaskDescription().getSolverDescription()); FVSolverStandalone fvSolver = new FVSolverStandalone(simTask,simulationDataDir,false); diff --git a/vcell-vmicro/src/main/java/org/vcell/vmicro/op/RunRefSimulationFastOp.java b/vcell-vmicro/src/main/java/org/vcell/vmicro/op/RunRefSimulationFastOp.java index 419d915b6b..93accf531d 100644 --- a/vcell-vmicro/src/main/java/org/vcell/vmicro/op/RunRefSimulationFastOp.java +++ b/vcell-vmicro/src/main/java/org/vcell/vmicro/op/RunRefSimulationFastOp.java @@ -8,6 +8,9 @@ import java.util.Date; import cbit.vcell.solver.*; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationJob; +import cbit.vcell.solver.simulation.SimulationOwner; import org.vcell.util.ClientTaskStatusSupport; import org.vcell.util.Extent; import org.vcell.util.ISize; @@ -51,7 +54,7 @@ import cbit.vcell.math.MathDescription; import cbit.vcell.math.RowColumnResultSet; import cbit.vcell.math.VariableType; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.model.Feature; import cbit.vcell.model.Membrane; import cbit.vcell.model.Model; @@ -377,7 +380,7 @@ private void runFVSolverStandalone( } int jobIndex = 0; - SimulationTask simTask = new SimulationTask(new SimulationJob(sim,jobIndex, fieldDataIdentifierSpecs),0); + StandardSimulationTask simTask = new StandardSimulationTask(new SimulationJob(sim,jobIndex, fieldDataIdentifierSpecs),0); SolverUtilities.prepareSolverExecutable(sim.getSolverTaskDescription().getSolverDescription()); //if we need to check steady state, do the following two lines diff --git a/vcell-vmicro/src/main/java/org/vcell/vmicro/op/RunRefSimulationOp.java b/vcell-vmicro/src/main/java/org/vcell/vmicro/op/RunRefSimulationOp.java index c612f1d41c..59dc3a1b5e 100644 --- a/vcell-vmicro/src/main/java/org/vcell/vmicro/op/RunRefSimulationOp.java +++ b/vcell-vmicro/src/main/java/org/vcell/vmicro/op/RunRefSimulationOp.java @@ -6,6 +6,9 @@ import java.util.Date; import cbit.vcell.solver.*; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationJob; +import cbit.vcell.solver.simulation.SimulationOwner; import org.vcell.util.ClientTaskStatusSupport; import org.vcell.util.Extent; import org.vcell.util.ISize; @@ -33,10 +36,8 @@ import cbit.vcell.field.FieldDataIdentifierSpec; import cbit.vcell.field.FieldFunctionArguments; import cbit.vcell.field.FieldUtilities; -import cbit.vcell.field.io.FieldDataFileOperationSpec; import cbit.vcell.geometry.Geometry; import cbit.vcell.geometry.ImageSubVolume; -import cbit.vcell.geometry.RegionImage; import cbit.vcell.geometry.SubVolume; import cbit.vcell.geometry.SurfaceClass; import cbit.vcell.mapping.FeatureMapping; @@ -44,7 +45,7 @@ import cbit.vcell.mapping.SimulationContext; import cbit.vcell.mapping.SpeciesContextSpec; import cbit.vcell.math.VariableType; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.model.Feature; import cbit.vcell.model.Membrane; import cbit.vcell.model.Model; @@ -52,9 +53,7 @@ import cbit.vcell.model.SpeciesContext; import cbit.vcell.parser.Expression; import cbit.vcell.simdata.SimDataBlock; -import cbit.vcell.simdata.SimDataConstants; import cbit.vcell.solver.server.SolverStatus; -import cbit.vcell.solvers.CartesianMesh; import cbit.vcell.solvers.FVSolverStandalone; public class RunRefSimulationOp { @@ -140,7 +139,7 @@ private static void runFVSolverStandalone( } int jobIndex = 0; - SimulationTask simTask = new SimulationTask(new SimulationJob(sim,jobIndex, fieldDataIdentifierSpecs),0); + StandardSimulationTask simTask = new StandardSimulationTask(new SimulationJob(sim,jobIndex, fieldDataIdentifierSpecs),0); SolverUtilities.prepareSolverExecutable(sim.getSolverTaskDescription().getSolverDescription()); //if we need to check steady state, do the following two lines diff --git a/vcell-vmicro/src/main/java/org/vcell/vmicro/op/RunSimulation2DOp.java b/vcell-vmicro/src/main/java/org/vcell/vmicro/op/RunSimulation2DOp.java index bfd92f2f49..4fa03ff303 100644 --- a/vcell-vmicro/src/main/java/org/vcell/vmicro/op/RunSimulation2DOp.java +++ b/vcell-vmicro/src/main/java/org/vcell/vmicro/op/RunSimulation2DOp.java @@ -14,10 +14,10 @@ import org.vcell.vmicro.workflow.data.LocalWorkspace; import cbit.vcell.VirtualMicroscopy.FloatImage; -import cbit.vcell.messaging.server.SimulationTask; +import cbit.vcell.messaging.server.StandardSimulationTask; import cbit.vcell.simdata.SimDataBlock; -import cbit.vcell.solver.Simulation; -import cbit.vcell.solver.SimulationJob; +import cbit.vcell.solver.simulation.Simulation; +import cbit.vcell.solver.simulation.SimulationJob; import cbit.vcell.solver.SolverUtilities; import cbit.vcell.solver.VCSimulationDataIdentifier; import cbit.vcell.solver.VCSimulationIdentifier; @@ -66,7 +66,7 @@ private static void runFVSolverStandalone( ClientTaskStatusSupport progressListener) throws Exception{ int jobIndex = 0; - SimulationTask simTask = new SimulationTask(new SimulationJob(sim,jobIndex, null),0); + StandardSimulationTask simTask = new StandardSimulationTask(new SimulationJob(sim,jobIndex, null),0); SolverUtilities.prepareSolverExecutable(sim.getSolverTaskDescription().getSolverDescription()); FVSolverStandalone fvSolver = new FVSolverStandalone(simTask,simulationDataDir,false); diff --git a/vcell-vmicro/src/main/java/org/vcell/vmicro/op/apps/KenworthyParticleTest.java b/vcell-vmicro/src/main/java/org/vcell/vmicro/op/apps/KenworthyParticleTest.java index 611fdbcf8a..b4ab17fc56 100644 --- a/vcell-vmicro/src/main/java/org/vcell/vmicro/op/apps/KenworthyParticleTest.java +++ b/vcell-vmicro/src/main/java/org/vcell/vmicro/op/apps/KenworthyParticleTest.java @@ -33,7 +33,7 @@ import cbit.vcell.VirtualMicroscopy.UShortImage; import cbit.vcell.math.CSV; import cbit.vcell.math.RowColumnResultSet; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; public class KenworthyParticleTest { diff --git a/vcell-vmicro/src/main/java/org/vcell/vmicro/op/apps/KenworthyWorkflowTest.java b/vcell-vmicro/src/main/java/org/vcell/vmicro/op/apps/KenworthyWorkflowTest.java index c6c6458510..961e37a8af 100644 --- a/vcell-vmicro/src/main/java/org/vcell/vmicro/op/apps/KenworthyWorkflowTest.java +++ b/vcell-vmicro/src/main/java/org/vcell/vmicro/op/apps/KenworthyWorkflowTest.java @@ -40,7 +40,7 @@ import cbit.vcell.VirtualMicroscopy.ROI; import cbit.vcell.VirtualMicroscopy.UShortImage; import cbit.vcell.math.RowColumnResultSet; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; public class KenworthyWorkflowTest { diff --git a/vcell-vmicro/src/main/java/org/vcell/vmicro/op/apps/PhotoactivationExperimentTest.java b/vcell-vmicro/src/main/java/org/vcell/vmicro/op/apps/PhotoactivationExperimentTest.java index d9b85b27c0..f8d9ac6216 100644 --- a/vcell-vmicro/src/main/java/org/vcell/vmicro/op/apps/PhotoactivationExperimentTest.java +++ b/vcell-vmicro/src/main/java/org/vcell/vmicro/op/apps/PhotoactivationExperimentTest.java @@ -38,7 +38,7 @@ import cbit.vcell.VirtualMicroscopy.UShortImage; import cbit.vcell.math.RowColumnResultSet; import cbit.vcell.opt.Parameter; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; public class PhotoactivationExperimentTest { diff --git a/vcell-vmicro/src/main/java/org/vcell/vmicro/op/display/DisplayImageOp.java b/vcell-vmicro/src/main/java/org/vcell/vmicro/op/display/DisplayImageOp.java index c45ed875f1..235b63cb06 100644 --- a/vcell-vmicro/src/main/java/org/vcell/vmicro/op/display/DisplayImageOp.java +++ b/vcell-vmicro/src/main/java/org/vcell/vmicro/op/display/DisplayImageOp.java @@ -38,7 +38,7 @@ import cbit.vcell.simdata.SpatialSelection; import cbit.vcell.simdata.SpatialSelectionVolume; import cbit.vcell.simdata.gui.CurveValueProvider; -import cbit.vcell.solver.SimulationModelInfo.DataSymbolMetadataResolver; +import cbit.vcell.solver.simulation.SimulationModelInfo.DataSymbolMetadataResolver; import cbit.vcell.solvers.CartesianMesh; public class DisplayImageOp { diff --git a/vcell-vmicro/src/main/java/org/vcell/vmicro/workflow/task/Generate2DExpModel_GaussianBleach.java b/vcell-vmicro/src/main/java/org/vcell/vmicro/workflow/task/Generate2DExpModel_GaussianBleach.java index 17664b458d..8666cf5108 100644 --- a/vcell-vmicro/src/main/java/org/vcell/vmicro/workflow/task/Generate2DExpModel_GaussianBleach.java +++ b/vcell-vmicro/src/main/java/org/vcell/vmicro/workflow/task/Generate2DExpModel_GaussianBleach.java @@ -12,7 +12,7 @@ import org.vcell.workflow.TaskContext; import cbit.vcell.biomodel.BioModel; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; public class Generate2DExpModel_GaussianBleach extends Task { diff --git a/vcell-vmicro/src/main/java/org/vcell/vmicro/workflow/task/Generate2DExpModel_UniformBleach.java b/vcell-vmicro/src/main/java/org/vcell/vmicro/workflow/task/Generate2DExpModel_UniformBleach.java index 2aed7eb3e2..22da6404cd 100644 --- a/vcell-vmicro/src/main/java/org/vcell/vmicro/workflow/task/Generate2DExpModel_UniformBleach.java +++ b/vcell-vmicro/src/main/java/org/vcell/vmicro/workflow/task/Generate2DExpModel_UniformBleach.java @@ -12,7 +12,7 @@ import org.vcell.workflow.TaskContext; import cbit.vcell.biomodel.BioModel; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; public class Generate2DExpModel_UniformBleach extends Task { diff --git a/vcell-vmicro/src/main/java/org/vcell/vmicro/workflow/task/RunFakeSim.java b/vcell-vmicro/src/main/java/org/vcell/vmicro/workflow/task/RunFakeSim.java index 5a028d3416..2ed4097662 100644 --- a/vcell-vmicro/src/main/java/org/vcell/vmicro/workflow/task/RunFakeSim.java +++ b/vcell-vmicro/src/main/java/org/vcell/vmicro/workflow/task/RunFakeSim.java @@ -9,7 +9,7 @@ import org.vcell.workflow.TaskContext; import cbit.vcell.VirtualMicroscopy.UShortImage; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; public class RunFakeSim extends Task { diff --git a/vcell-vmicro/src/main/java/org/vcell/vmicro/workflow/task/RunSimulation2D.java b/vcell-vmicro/src/main/java/org/vcell/vmicro/workflow/task/RunSimulation2D.java index 4a8231f8a3..e2240f614f 100644 --- a/vcell-vmicro/src/main/java/org/vcell/vmicro/workflow/task/RunSimulation2D.java +++ b/vcell-vmicro/src/main/java/org/vcell/vmicro/workflow/task/RunSimulation2D.java @@ -10,7 +10,7 @@ import org.vcell.workflow.TaskContext; import cbit.vcell.VirtualMicroscopy.FloatImage; -import cbit.vcell.solver.Simulation; +import cbit.vcell.solver.simulation.Simulation; public class RunSimulation2D extends Task {