public class CarbonAccountingTool extends AbstractGenericEngine implements REpiceaShowableUIWithParent, REpiceaShowableUI
| Modifier and Type | Class and Description |
|---|---|
static class |
CarbonAccountingTool.CATMode |
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
englishTitle |
protected boolean |
finalCutHadToBeCarriedOut |
protected static java.lang.String |
frenchTitle |
protected CATFrame |
guiInterface |
protected static boolean |
hasAlreadyBeenInstanciated |
protected java.awt.Window |
owner |
protected java.awt.Window |
parentFrame |
protected java.util.List<CATCompatibleStand> |
waitingStandList |
finalTask, logger, queue, tasksDone| Constructor and Description |
|---|
CarbonAccountingTool()
Constructor for stand alone application.
|
CarbonAccountingTool(CarbonAccountingTool.CATMode mode)
Generic constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
calculateCarbon()
This method launches the calculation of the different carbon compartments.
|
CATExportTool |
createExportTool()
This method returns an export tool adapted to the carbon accounting tool.
|
protected void |
decideWhatToDoInCaseOfFailure(GenericTask task)
This method is called whenever an exception is thrown while running a task.
|
protected java.util.Vector<TreeLoggerDescription> |
findMatchingTreeLoggers(TreeLoggerCompatibilityCheck check) |
protected void |
firstTasksToDo()
This method sets the first tasks to execute when the engine starts.
|
protected CATCompartmentManager |
getCarbonCompartmentManager() |
protected CATSettings |
getCarbonToolSettings()
This method returns the settings of the carbon accounting tool.
|
CATFrame |
getUI()
This method returns the GUI interface of the class that implements this interface.
|
CATFrame |
getUI(java.awt.Container parent)
This method returns the GUI interface of the class that implements this interface.
|
void |
initializeTool()
Initializes CAT without parent window.
|
void |
initializeTool(java.awt.Window parentFrame)
This method initializes the carbon accounting tool either in script or in GUI mode.
|
protected boolean |
isGuiEnabled() |
boolean |
isInitialized()
This method returns true if this CAT instance has been initialized or false otherwise
|
boolean |
isShuttedDown()
This method returns true if CAT has been shutted down or false otherwise.
|
boolean |
isVisible()
This method returns true if the GUI is visible.
|
protected void |
lockEngine()
This method locks the engine while the interface can be doing something else.
|
static void |
main(java.lang.String[] args) |
protected void |
respondToWindowClosing()
By default, closing the gui shuts the engine down.
|
CATSimulationResult |
retrieveSimulationSummary()
This method retrieves the simulation results after calling the calculateCarbon method.
|
protected void |
setBiomassParameters() |
void |
setBiomassParameters(java.lang.String filename)
This method sets the biomass parameters for the next simulation in script mode.
|
protected void |
setFinalCutHadToBeCarriedOut(boolean finalCutHadToBeCarriedOut) |
protected void |
setProductionManager() |
void |
setProductionManager(java.lang.String filename)
This method sets the production lines for the next simulation in script mode.
|
protected void |
setStandList() |
void |
setStandList(java.util.List<CATCompatibleStand> standList)
This method sets the list of stands from which the carbon balance should be calculated.
|
void |
setVariabilitySource(CATSensitivityAnalysisSettings.VariabilitySource source,
Distribution.Type type,
boolean enabled)
This method sets the different parameters of the sensitivity analysis at the level suggested by the IPCC.
|
void |
setVariabilitySource(CATSensitivityAnalysisSettings.VariabilitySource source,
Distribution.Type type,
boolean enabled,
double multiplier)
This method sets the different parameters of the sensitivity analysis
|
void |
setVerboseEnabled(boolean bool)
This method enables messages all along the process chain.
|
protected void |
showResult() |
void |
showUI()
This method shows the GUI interface of the class that implements this interface.
|
void |
showUI(java.awt.Window parent)
This method shows the GUI interface of the class that implements this interface.
|
protected void |
shutdown(int shutdownCode) |
protected void |
unlockEngine()
This method unlock the engine if locked.
|
addTask, addTasks, cancelRunningTask, getSettingMemory, lockEngine, requestShutdown, setSettingMemory, startApplicationprotected static final java.lang.String englishTitle
protected static final java.lang.String frenchTitle
protected static boolean hasAlreadyBeenInstanciated
protected boolean finalCutHadToBeCarriedOut
protected java.awt.Window parentFrame
protected java.util.List<CATCompatibleStand> waitingStandList
protected transient CATFrame guiInterface
protected transient java.awt.Window owner
public CarbonAccountingTool()
public CarbonAccountingTool(CarbonAccountingTool.CATMode mode)
mode - defines how CAT is to be used. See the CATMode enum variable.protected void shutdown(int shutdownCode)
shutdown in class AbstractGenericEnginepublic boolean isShuttedDown()
protected CATSettings getCarbonToolSettings()
public void setVerboseEnabled(boolean bool)
bool - public void initializeTool()
throws java.lang.Exception
java.lang.Exceptionpublic void initializeTool(java.awt.Window parentFrame)
throws java.lang.Exception
parentFrame - the parent frame which can be nulljava.lang.Exceptionpublic void setStandList(java.util.List<CATCompatibleStand> standList)
standList - a List of CarbonToolCompatibleStand instanceprotected void setStandList()
protected java.util.Vector<TreeLoggerDescription> findMatchingTreeLoggers(TreeLoggerCompatibilityCheck check)
protected void firstTasksToDo()
AbstractGenericEnginefirstTasksToDo in class AbstractGenericEngineprotected void decideWhatToDoInCaseOfFailure(GenericTask task)
AbstractGenericEnginedecideWhatToDoInCaseOfFailure in class AbstractGenericEnginetask - a GenericTask instancepublic CATSimulationResult retrieveSimulationSummary()
protected CATCompartmentManager getCarbonCompartmentManager()
public void calculateCarbon()
throws java.security.InvalidParameterException,
java.lang.InterruptedException
java.lang.InterruptedException - if the engine lock is interruptedjava.security.InvalidParameterException - if the CarbonToolSettings instance is invalidprotected boolean isGuiEnabled()
protected void unlockEngine()
AbstractGenericEngineunlockEngine in class AbstractGenericEngineprotected void lockEngine()
throws java.lang.InterruptedException
AbstractGenericEnginelockEngine in class AbstractGenericEnginejava.lang.InterruptedExceptionprotected void setFinalCutHadToBeCarriedOut(boolean finalCutHadToBeCarriedOut)
public CATExportTool createExportTool() throws java.lang.Exception
java.lang.Exceptionprotected void respondToWindowClosing()
public CATFrame getUI(java.awt.Container parent)
REpiceaUIObjectWithParentgetUI in interface REpiceaUIObjectWithParentparent - a parent Container instance (can be null)public void showUI(java.awt.Window parent)
REpiceaShowableUIWithParentshowUI in interface REpiceaShowableUIWithParentparent - the parent Window instance (can be null)public CATFrame getUI()
REpiceaUIObjectgetUI in interface REpiceaUIObjectpublic void showUI()
REpiceaShowableUIshowUI in interface REpiceaShowableUIprotected void showResult()
public boolean isVisible()
REpiceaUIObjectWithParentisVisible in interface REpiceaUIObjectisVisible in interface REpiceaUIObjectWithParentpublic void setBiomassParameters(java.lang.String filename)
throws java.lang.InterruptedException
filename - a String that defines the filename (.bpf) of the biomass parametersjava.lang.InterruptedExceptionjava.io.IOExceptionprotected void setBiomassParameters()
throws java.io.IOException
java.io.IOExceptionpublic void setProductionManager(java.lang.String filename)
throws java.lang.InterruptedException
filename - a String that defines the filename (.prl) of the processor managerjava.lang.InterruptedExceptionjava.io.IOExceptionprotected void setProductionManager()
throws java.io.IOException
java.io.IOExceptionpublic void setVariabilitySource(CATSensitivityAnalysisSettings.VariabilitySource source, Distribution.Type type, boolean enabled)
source - the source of variabilitytype - the distribution (either uniform (default) or Gaussianenabled - true to enable or false to disablepublic void setVariabilitySource(CATSensitivityAnalysisSettings.VariabilitySource source, Distribution.Type type, boolean enabled, double multiplier)
source - the source of variabilitytype - the distribution (either uniform (default) or Gaussianenabled - true to enable or false to disablemultiplier - a value between 0.0 and 0.5 (50%)public boolean isInitialized()
public static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exception