use of cbit.vcell.solver.Simulation in project vcell by virtualcell.
the class SimulationListPanel method editSimulation.
/**
* Comment
*/
private void editSimulation() {
// this should not be possible to call unless exactly one row is selected, but check anyway
int[] selectedRows = getScrollPaneTable().getSelectedRows();
if (selectedRows.length > 0) {
// make sure something is selected...
Simulation sim = (Simulation) (ivjSimulationListTableModel1.getValueAt(selectedRows[0]));
SimulationStatus simStatus = getSimulationWorkspace().getSimulationStatus(sim);
if (!simStatus.isRunning()) {
// just the first one if more than one selected...
SimulationWorkspace.editSimulation(this, getSimulationWorkspace().getSimulationOwner(), sim);
// need to check if parallel option changed
refreshButtonsLax();
}
}
}
use of cbit.vcell.solver.Simulation in project vcell by virtualcell.
the class SimulationListPanel method quickRun.
/*
private void particleView() {
int row = getScrollPaneTable().getSelectedRow();
if (row < 0) {
return;
}
Simulation selectedSim = getSimulationListTableModel1().getValueAt(row);
getSimulationWorkspace().getClientSimManager().runSmoldynParticleView(selectedSim);
}
*/
private void quickRun(ViewerType viewerType) {
int row = getScrollPaneTable().getSelectedRow();
if (row < 0) {
return;
}
activateConsole();
Simulation selectedSim = getSimulationListTableModel1().getValueAt(row);
SolverDescription solverDescription = selectedSim.getSolverTaskDescription().getSolverDescription();
if (solverDescription.equals(SolverDescription.FiniteVolume)) {
if (getSimulationWorkspace().getSimulationOwner() instanceof SimulationContext) {
String option = DialogUtils.showOKCancelWarningDialog(SimulationListPanel.this, "Deprecated Solver", VCellErrorMessages.getSemiFVSolverCompiledSolverDeprecated(selectedSim));
if (option.equals(SimpleUserMessage.OPTION_CANCEL)) {
return;
}
try {
selectedSim.getSolverTaskDescription().setSolverDescription(SolverDescription.FiniteVolumeStandalone);
selectedSim.setIsDirty(true);
} catch (PropertyVetoException e) {
e.printStackTrace();
}
}
}
getSimulationWorkspace().getClientSimManager().runQuickSimulation(selectedSim, viewerType);
}
use of cbit.vcell.solver.Simulation in project vcell by virtualcell.
the class SimulationListPanel method runSimulations.
/**
* Comment
*/
private void runSimulations() {
final ArrayList<Simulation> simList = new ArrayList<Simulation>();
int[] selections = getScrollPaneTable().getSelectedRows();
for (int i = 0; i < selections.length; i++) {
Simulation sim = (Simulation) (ivjSimulationListTableModel1.getValueAt(selections[i]));
if (sim.getSolverTaskDescription().getSolverDescription().equals(SolverDescription.FiniteVolume)) {
if (getSimulationWorkspace().getSimulationOwner() instanceof SimulationContext) {
String option = DialogUtils.showOKCancelWarningDialog(SimulationListPanel.this, "Deprecated Solver", VCellErrorMessages.getSemiFVSolverCompiledSolverDeprecated(sim));
if (option.equals(SimpleUserMessage.OPTION_CANCEL)) {
return;
}
try {
sim.getSolverTaskDescription().setSolverDescription(SolverDescription.FiniteVolumeStandalone);
sim.setIsDirty(true);
} catch (PropertyVetoException e) {
e.printStackTrace();
}
}
}
simList.add(sim);
}
if (simList.size() > 0) {
activateConsole();
Simulation[] toRun = simList.toArray(new Simulation[0]);
getSimulationWorkspace().runSimulations(toRun, this);
}
}
use of cbit.vcell.solver.Simulation in project vcell by virtualcell.
the class SimulationStatusDetailsPanel method simulationStatusDetailsPanel_SimulationStatusDetails.
/**
* Comment
*/
public void simulationStatusDetailsPanel_SimulationStatusDetails(cbit.vcell.client.desktop.simulation.SimulationStatusDetails simStatusDetails) {
if (simStatusDetails == null) {
return;
}
Simulation sim = simStatusDetails.getSimulation();
getNameTextField().setText(sim.getName());
getIDTextField().setText("" + (sim.getKey() != null ? sim.getKey().toString() : "") + (sim.getSimulationVersion() != null && sim.getSimulationVersion().getParentSimulationReference() != null ? " (parentSimRef=" + sim.getSimulationVersion().getParentSimulationReference().toString() + ")" : ""));
getSolverTextField().setText(sim.getSolverTaskDescription().getSolverDescription().getDisplayLabel());
return;
}
use of cbit.vcell.solver.Simulation in project vcell by virtualcell.
the class SimulationWorkspace method getExpectedSizeBytes.
/**
* Insert the method's description here.
* Creation date: (6/12/2001 10:09:25 AM)
* @return boolean
* @param simulation cbit.vcell.solver.Simulation
*/
private static long getExpectedSizeBytes(SimulationSymbolTable simSymbolTable) {
Simulation simulation = simSymbolTable.getSimulation();
long numTimepoints;
if (simulation.getMathDescription().isNonSpatialStoch()) {
numTimepoints = getEstimatedNumTimePointsForStoch(simSymbolTable);
} else {
numTimepoints = getExpectedNumTimePoints(simulation);
}
int x, y, z;
int numVariables = 0;
if (simulation.isSpatial()) {
x = simulation.getMeshSpecification().getSamplingSize().getX();
y = simulation.getMeshSpecification().getSamplingSize().getY();
z = simulation.getMeshSpecification().getSamplingSize().getZ();
//
// compute number of volume variables only (they are multiplied by x*y*z)
//
numVariables = 0;
Enumeration<Variable> variables = simulation.getMathDescription().getVariables();
while (variables.hasMoreElements()) {
Variable var = variables.nextElement();
if (var instanceof VolVariable) {
numVariables++;
}
}
} else {
x = 1;
y = 1;
z = 1;
numVariables = 0;
Enumeration<Variable> variables = simulation.getMathDescription().getVariables();
while (variables.hasMoreElements()) {
Variable var = variables.nextElement();
if ((var instanceof VolVariable) || (var instanceof Function)) {
numVariables++;
}
}
}
// approximate, don't compute header size since it's negligible whenever we approach quota size anyway...
// values are actually written as longs
long expectedSize = numTimepoints * numVariables * x * y * z * 8;
return expectedSize;
}
Aggregations