Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

146 openfoam example #147

Draft
wants to merge 197 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
197 commits
Select commit Hold shift + click to select a range
73b23ce
Moved Role to IExchangeItem and added PrevRole en getPrevRole to IPre…
aljavrieling Aug 29, 2019
97ad26d
removed model_delft3d from build.xml
aljavrieling Sep 3, 2019
7171979
eliminated all direct implementations of IPrevExchangeItem
aljavrieling Sep 3, 2019
237eae8
Initial code model external socket
erikpelgrim Nov 25, 2019
f2b1e65
Add config reader test case
erikpelgrim Nov 26, 2019
c2f7a22
Add config reader test case
erikpelgrim Nov 26, 2019
e5e5d43
Use model results as observed values
erikpelgrim Nov 26, 2019
9df4476
Move external socket code to model instance
erikpelgrim Nov 29, 2019
3f7b0ea
Implement compute for External socket model
erikpelgrim Nov 29, 2019
e5f6cce
Implement sendFinalParameters for External socket model
erikpelgrim Dec 2, 2019
7cd12f6
Add model_external_socket to build.xml
erikpelgrim Dec 2, 2019
3438834
Rename Exchange Items to ExternalSocketParameter & ExternalSocketResult
erikpelgrim Dec 5, 2019
9ae9717
Lookup local host address instead of hardcoded 127.0.0.1
erikpelgrim Dec 5, 2019
b7ccd44
Add logging for debugging non responsive Socket
erikpelgrim Dec 5, 2019
4d1bc66
Add wait for socket input stream
erikpelgrim Dec 6, 2019
e46083f
Use DataInputStream to prevent blocking
erikpelgrim Dec 6, 2019
e041149
Do not wait for response after sending final parameters
erikpelgrim Dec 6, 2019
2682431
Add ExternalSocketSimplexAlgorithm
erikpelgrim Dec 9, 2019
719ec19
Add ExternalSocketSCEAlgorithm
erikpelgrim Dec 9, 2019
af94e5c
Add ExternalSocketPowellAlgorithm
erikpelgrim Dec 9, 2019
54d635f
Add ExternalSocketGriddedFullSearchAlgorithm
erikpelgrim Dec 9, 2019
6b7afca
Add ExternalSocketConjugateGradientAlgorithm and ExternalSocketConjug…
erikpelgrim Dec 9, 2019
cd20100
Add ExternalSocketBFGSAlgorithm
erikpelgrim Dec 9, 2019
1644829
Support flexible number of model results
erikpelgrim Dec 12, 2019
463c3d4
Revert "removed model_delft3d from build.xml"
aljavrieling Dec 24, 2019
b3f0933
eliminated implements IPrevExchangeItem in model_delft3d
aljavrieling Dec 24, 2019
0b950ff
eliminated getValueType, replaced by method getValuesType of IExchang…
aljavrieling Dec 24, 2019
6da22a8
moved remaining methods from IPrevExchangeItem to IExchangeItem and r…
aljavrieling Dec 24, 2019
7256c57
removed unused import statements and last occurences of IPrevExchange…
aljavrieling Dec 24, 2019
ec92a72
Speed up socket client waiting for data
erikpelgrim Jan 9, 2020
e8d55be
Add sending optional standard deviation to final parameters
erikpelgrim Jan 13, 2020
63be83b
Replaced IoObjectInterface by IDataObject for D3dField2Dfile
theavuik Feb 25, 2020
e50cece
Removed getExchangeItems() from D3dField2Dfile
theavuik Feb 25, 2020
7ad4927
Add @Override to D3dField2Dfile functions initialize and finish
theavuik Feb 25, 2020
e1a7444
Replaced IoObjectInterface by IDataObject for D3dAstroComponentFiles
theavuik Feb 25, 2020
ecb5b63
Add comments & style improvements
wkramer Mar 2, 2020
ca45722
Added more imports to reduce Codacy issues
theavuik Mar 3, 2020
04aada0
Merge branch '107-eliminate-IPrevExchangeItem' of https://github.com/…
wkramer Mar 3, 2020
bd77c20
Implemented AbstractDataObject and used this class in D3dRoughParamsFile
theavuik Mar 3, 2020
b053b07
Merge remote-tracking branch 'origin/107-eliminate-IPrevExchangeItem'…
theavuik Mar 3, 2020
a67f018
Replaced IoObjectInterface by extension of AbstractDataObject for Dum…
theavuik Mar 3, 2020
756189e
Removed unused class DummyIoObject
theavuik Mar 3, 2020
865e384
Replaced IoObjectInterface by extension of AbstractDataObject for Dum…
theavuik Mar 3, 2020
25eebb1
Reduce Codacy errors
theavuik Mar 3, 2020
cddd208
Use of AbstractDataObject for DummySeries
theavuik Mar 3, 2020
1028fa3
Use of AbstractDataObject for DummyTimeInfoIoObject
theavuik Mar 3, 2020
646e573
Removed unused imports
theavuik Mar 3, 2020
7fa5a46
Update for DummyState
theavuik Mar 3, 2020
3192bf3
Implementation of getExchangeItemIDs for roles.
theavuik Mar 3, 2020
2c7d7f8
Improve codacy log of AbstractDataObject
theavuik Mar 3, 2020
0a60c09
Update of test since the number of IOObjectInterfaces reduces
theavuik Mar 3, 2020
e37feca
Use of AbstractDataObject for EfdcEventTox2InploObject
theavuik Mar 3, 2020
8d8d0bf
Reduce codacy errors
theavuik Mar 10, 2020
956c5d5
Use of AbstractDataObject for EfdcGridTimeSeriesIoObject
theavuik Mar 10, 2020
bc79371
UIModel: remove unused imports
theavuik Mar 10, 2020
94e6926
Removed unused DummySeries class
theavuik Mar 10, 2020
139ec90
Use of AbstractDataObject for EfdcInpIoObject
theavuik Mar 10, 2020
f7827ef
Use of AbstractDataObject for EfdcRestartFileIoObject
theavuik Mar 10, 2020
568eede
AbstractDataObject: added comments
theavuik Mar 10, 2020
f0ac31e
EfdcTimeSeriesIoObject: used AbstractDataObject
theavuik Mar 10, 2020
0ae188d
ForcingWrapper: used AbstractDataObject
theavuik Mar 17, 2020
76d358d
Reduce IntelliJ yellow remarks
theavuik Mar 17, 2020
0a0fac9
Reduce IntelliJ yellow remarks - part 2
theavuik Mar 25, 2020
5a14b47
Undo Deprecated statement in UciIoObject for now
theavuik Mar 25, 2020
0bbc970
SimpleBbAsciiFile: use AbstractDataobject
theavuik Mar 25, 2020
2f64902
Check if the ids from getExchangeItemIDs equal those from exchangeIte…
theavuik Mar 31, 2020
43aad9c
Small improvements
theavuik Mar 31, 2020
23f4e3e
Update of InitialStatesWrapper
theavuik Apr 14, 2020
61c5fda
NoosDataObject: updated to use AbstractDataObject, new noos files, an…
theavuik Apr 28, 2020
b688427
ParametersWrapper: use of AbstractDataObject
theavuik Apr 28, 2020
3383647
Fix for noos files in dataobject tests
theavuik Apr 28, 2020
4036fd6
Use dates instead of mjd in NoosDataObjectTest
theavuik May 19, 2020
333468e
AbstractDataObject for ResultFileWrapper
theavuik May 19, 2020
b67cd13
AbstractDataObject for TimesWrapper
theavuik May 19, 2020
f993020
AbstractDataObject for TreeVectorIoObject
theavuik May 26, 2020
96cc025
Renaming to dataObject, and better objects
theavuik May 26, 2020
4e119ca
Renaming to dataObject, and small updates
theavuik May 26, 2020
4481d6e
AbstractDataObject for myWrapper
theavuik Jun 16, 2020
90eaac3
The model, the cfg and the observations.
MarcDuQuesne Jul 7, 2020
1dad7dc
Added a readme with the versions of the software.
MarcDuQuesne Jul 7, 2020
062243d
Using the python format for the results instead of matlab.
MarcDuQuesne Jul 7, 2020
eac96f7
Added the cfg files to use DUD instead of EnKF.
MarcDuQuesne Jul 7, 2020
dd75df6
Added file missing because of a .gitignore
MarcDuQuesne Jul 7, 2020
fec1abb
ioObjects: test such that old ioobjects still work
theavuik Jul 7, 2020
a30a34b
From ioObject to dataObject: update of xsd
theavuik Jul 7, 2020
366346b
java: updates of files where ioObject was wrongly used
theavuik Jul 7, 2020
fe310df
xmls changed such that dataobjects are used instead of ioobjects
theavuik Jul 7, 2020
1e6670e
Updated the model to a newer version.
MarcDuQuesne Jul 7, 2020
cf0043c
Adapted the configuration files to the new model.
MarcDuQuesne Jul 7, 2020
f751574
Add dictionary for IoObjects renamed to DataObjects
erikpelgrim Aug 5, 2020
736461b
Improved IoObject->DataObject backwards compatibility.
Aug 6, 2020
be0f9c1
Remove usage of BBStochModel
erikpelgrim Sep 10, 2020
406a38e
Codacy fixes
erikpelgrim Sep 14, 2020
77a9632
Codacy fixe
erikpelgrim Sep 14, 2020
01d44b2
Merge pull request #152 from OpenDA-Association/ProbabilisticToolKit
nilsvanvelzen Sep 15, 2020
7b4189d
Replace IPrevExchangeItem.Role
wkramer Nov 13, 2020
9d2dbae
Fix for allElementsFromDataObject
wkramer Nov 13, 2020
3c54758
Explicit Role import
wkramer Nov 13, 2020
a1d5cf2
Revert previous commit
wkramer Nov 13, 2020
5ada202
Put CoreResources in modules instead of separate jar files from them
theavuik Nov 17, 2020
0a31f87
Custom added to ValueTypes for ExchangeItems, and added todos for rep…
theavuik Nov 24, 2020
e17fe48
Fixed xml-parsing for dataObject and IoObject based stochObserver
Nov 24, 2020
c21c00b
Improved logging of metaswap state file changes
Nov 27, 2020
e415c91
Moved Role to IExchangeItem and added PrevRole en getPrevRole to IPre…
aljavrieling Aug 29, 2019
83ebbce
removed model_delft3d from build.xml
aljavrieling Sep 3, 2019
4d6c211
eliminated all direct implementations of IPrevExchangeItem
aljavrieling Sep 3, 2019
bcbc9c5
Revert "removed model_delft3d from build.xml"
aljavrieling Dec 24, 2019
9f41ebc
eliminated implements IPrevExchangeItem in model_delft3d
aljavrieling Dec 24, 2019
703da36
eliminated getValueType, replaced by method getValuesType of IExchang…
aljavrieling Dec 24, 2019
5ca8315
moved remaining methods from IPrevExchangeItem to IExchangeItem and r…
aljavrieling Dec 24, 2019
1fdd69a
removed unused import statements and last occurences of IPrevExchange…
aljavrieling Dec 24, 2019
679ab4c
Replaced IoObjectInterface by IDataObject for D3dField2Dfile
theavuik Feb 25, 2020
de32935
Removed getExchangeItems() from D3dField2Dfile
theavuik Feb 25, 2020
d5c9fe3
Add @Override to D3dField2Dfile functions initialize and finish
theavuik Feb 25, 2020
efb01f7
Replaced IoObjectInterface by IDataObject for D3dAstroComponentFiles
theavuik Feb 25, 2020
0850a4d
Added more imports to reduce Codacy issues
theavuik Mar 3, 2020
b5a7081
Implemented AbstractDataObject and used this class in D3dRoughParamsFile
theavuik Mar 3, 2020
f249d86
Add comments & style improvements
wkramer Mar 2, 2020
290dddf
Replaced IoObjectInterface by extension of AbstractDataObject for Dum…
theavuik Mar 3, 2020
aaa33b3
Removed unused class DummyIoObject
theavuik Mar 3, 2020
21d3573
Replaced IoObjectInterface by extension of AbstractDataObject for Dum…
theavuik Mar 3, 2020
acaac34
Reduce Codacy errors
theavuik Mar 3, 2020
69f43c7
Use of AbstractDataObject for DummySeries
theavuik Mar 3, 2020
8b5c0b2
Use of AbstractDataObject for DummyTimeInfoIoObject
theavuik Mar 3, 2020
11d3236
Removed unused imports
theavuik Mar 3, 2020
e4ad813
Update for DummyState
theavuik Mar 3, 2020
447a918
Implementation of getExchangeItemIDs for roles.
theavuik Mar 3, 2020
3d14f13
Improve codacy log of AbstractDataObject
theavuik Mar 3, 2020
3dc74b0
Update of test since the number of IOObjectInterfaces reduces
theavuik Mar 3, 2020
458ce3e
Use of AbstractDataObject for EfdcEventTox2InploObject
theavuik Mar 3, 2020
6619874
Reduce codacy errors
theavuik Mar 10, 2020
a717ede
Use of AbstractDataObject for EfdcGridTimeSeriesIoObject
theavuik Mar 10, 2020
16810ca
UIModel: remove unused imports
theavuik Mar 10, 2020
8b8f6d4
Removed unused DummySeries class
theavuik Mar 10, 2020
155f33e
Use of AbstractDataObject for EfdcInpIoObject
theavuik Mar 10, 2020
41ac1b5
Use of AbstractDataObject for EfdcRestartFileIoObject
theavuik Mar 10, 2020
f465aa9
AbstractDataObject: added comments
theavuik Mar 10, 2020
6024c9f
EfdcTimeSeriesIoObject: used AbstractDataObject
theavuik Mar 10, 2020
35a8c14
ForcingWrapper: used AbstractDataObject
theavuik Mar 17, 2020
f45401f
Reduce IntelliJ yellow remarks
theavuik Mar 17, 2020
176d84b
Reduce IntelliJ yellow remarks - part 2
theavuik Mar 25, 2020
220d125
Undo Deprecated statement in UciIoObject for now
theavuik Mar 25, 2020
a7bd746
SimpleBbAsciiFile: use AbstractDataobject
theavuik Mar 25, 2020
203f7f9
Check if the ids from getExchangeItemIDs equal those from exchangeIte…
theavuik Mar 31, 2020
a6392fc
Small improvements
theavuik Mar 31, 2020
9754965
Update of InitialStatesWrapper
theavuik Apr 14, 2020
88a508e
NoosDataObject: updated to use AbstractDataObject, new noos files, an…
theavuik Apr 28, 2020
c887603
ParametersWrapper: use of AbstractDataObject
theavuik Apr 28, 2020
283d1e7
Fix for noos files in dataobject tests
theavuik Apr 28, 2020
10792f7
Use dates instead of mjd in NoosDataObjectTest
theavuik May 19, 2020
124ab94
AbstractDataObject for ResultFileWrapper
theavuik May 19, 2020
38c2900
AbstractDataObject for TimesWrapper
theavuik May 19, 2020
2e30121
AbstractDataObject for TreeVectorIoObject
theavuik May 26, 2020
ee859bb
Renaming to dataObject, and better objects
theavuik May 26, 2020
7cbd489
Renaming to dataObject, and small updates
theavuik May 26, 2020
996e506
AbstractDataObject for myWrapper
theavuik Jun 16, 2020
440c9db
ioObjects: test such that old ioobjects still work
theavuik Jul 7, 2020
a6b20c8
From ioObject to dataObject: update of xsd
theavuik Jul 7, 2020
b1706ac
java: updates of files where ioObject was wrongly used
theavuik Jul 7, 2020
769cf70
xmls changed such that dataobjects are used instead of ioobjects
theavuik Jul 7, 2020
3272170
Add dictionary for IoObjects renamed to DataObjects
erikpelgrim Aug 5, 2020
2ea22cd
Improved IoObject->DataObject backwards compatibility.
Aug 6, 2020
f769f27
Replace IPrevExchangeItem.Role
wkramer Nov 13, 2020
2635473
Fix for allElementsFromDataObject
wkramer Nov 13, 2020
d71496c
Put CoreResources in modules instead of separate jar files from them
theavuik Nov 17, 2020
ae42f11
Custom added to ValueTypes for ExchangeItems, and added todos for rep…
theavuik Nov 24, 2020
4e59358
Fixed xml-parsing for dataObject and IoObject based stochObserver
Nov 24, 2020
c2cf186
Merge branch '107-eliminate-IPrevExchangeItem' of https://github.com/…
Nov 27, 2020
9aacd1b
First attempt to fix travis for model_external_socket
erikpelgrim Nov 30, 2020
879c87d
Second attempt to fix travis for model_external_socket
erikpelgrim Nov 30, 2020
82e609f
Second attempt to fix travis
erikpelgrim Nov 30, 2020
72a6b31
Disable local test
erikpelgrim Nov 30, 2020
6ed105f
Comment out local test
erikpelgrim Dec 1, 2020
c5c4a8b
Comment out local test, enable extra debug logging
erikpelgrim Dec 1, 2020
a794b05
Cleanup extra debug logging
erikpelgrim Dec 1, 2020
ed00435
Merge pull request #153 from OpenDA-Association/FixBuildProblems
nilsvanvelzen Dec 1, 2020
83de493
Update script for teamcity on the DPC according to suggestion of Tim …
erikpelgrim Dec 2, 2020
a0288f3
Update script for Teamcity on DPC, Deltares issue tracker TEAMCITY-286
aljavrieling Dec 8, 2020
d3525a9
Fixed compile errors that were a result of the removal of IPrevExchan…
Dec 8, 2020
08f75a6
Merge pull request #155 from OpenDA-Association/FixTeamCityDPC
nilsvanvelzen Dec 8, 2020
a4f1bbf
Remove iPrevExchangeItem from java files
theavuik Dec 8, 2020
099f2f1
Remove model_metaswap from iml
theavuik Dec 8, 2020
a087dd6
Add more options to valueTypes in IExchangeItem
theavuik Dec 8, 2020
7842a09
Remove 'required' for ioObjectId and dataObjectId in xsd
theavuik Dec 8, 2020
272ed83
Fix xsd's by adding deprecated ioObject element for backwards compati…
erikpelgrim Dec 10, 2020
f9b889c
Merge pull request #129 from OpenDA-Association/107-eliminate-IPrevEx…
Dec 15, 2020
fa2f33e
Remove oracle jdk from travis test
wkramer Mar 9, 2021
1bb43a2
Merge pull request #160 from OpenDA-Association/travis-disable-oraclejdk
nilsvanvelzen Mar 9, 2021
55eb934
The model, the cfg and the observations.
MarcDuQuesne Jul 7, 2020
a67e661
Added a readme with the versions of the software.
MarcDuQuesne Jul 7, 2020
0c5a8f8
Using the python format for the results instead of matlab.
MarcDuQuesne Jul 7, 2020
206e9bc
Added the cfg files to use DUD instead of EnKF.
MarcDuQuesne Jul 7, 2020
a032f21
Added file missing because of a .gitignore
MarcDuQuesne Jul 7, 2020
584e20e
Updated the model to a newer version.
MarcDuQuesne Jul 7, 2020
f49a4e8
Adapted the configuration files to the new model.
MarcDuQuesne Jul 7, 2020
ef498fc
Merge branch '146-openfoam-example' of https://github.com/OpenDA-Asso…
aljavrieling Mar 16, 2021
939ce09
Added README.md to explain the example, disclaimer for software versi…
aljavrieling Mar 16, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ opendaTestReports/
**/MANIFEST.MF
**/tests/*.log
OpenDATimings_*.txt
*.*~
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ sudo: required

jdk:
- openjdk11
- oraclejdk11

before_install:
- sudo apt-get update
Expand All @@ -18,7 +17,7 @@ before_install:


install: ./travis_install.sh
script: ./travis_test.sh
script: ./travis_test.sh

#after_script:
# - java -cp ~/codacy-coverage-reporter-assembly-latest.jar com.codacy.CodacyCoverageReporter -l Java -r build/reports/jacoco/test/jacocoTestReport.xml
Expand Down
19 changes: 1 addition & 18 deletions algorithms/java/algorithms.iml
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,6 @@
<orderEntry type="module" module-name="core" />
<orderEntry type="module" module-name="models" />
<orderEntry type="module" module-name="observers" />
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../core/java/resources/xom/xom-1.2.6.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../core/java/resources/junit/junit-3.8.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
Expand All @@ -53,5 +35,6 @@
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" name="CoreResources" level="project" />
</component>
</module>
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* along with OpenDA. If not, see <http://www.gnu.org/licenses/>.
*/
package org.openda.algorithms;
import org.openda.interfaces.IPrevExchangeItem;
import org.openda.interfaces.IExchangeItem;
import org.openda.interfaces.IObservationDescriptions;
import org.openda.interfaces.IVector;

Expand Down Expand Up @@ -72,17 +72,16 @@ public boolean checkForStop(IVector parameters, IVector residuals, double cost,
public boolean checkForStop(IVector parameters, IVector residuals, IObservationDescriptions descriptions, double cost, double threshold) {
boolean isStop = false;
this.threshold = threshold;
List<IPrevExchangeItem> items = descriptions.getExchangeItems();
List<IExchangeItem> items = descriptions.getExchangeItems();
this.nLoc = items.size();
this.isSatisfied = new boolean[this.nLoc];
this.Ids = new String[this.nLoc];
int indFirst = 0;
int indLast = 0;
double absAvg = 0.0;
double maxAbsAvg = Double.NEGATIVE_INFINITY;
// for(IPrevExchangeItem item : items){ // assume the exchangeItems are in the
for (int i=0; i<nLoc; i++) {
IPrevExchangeItem item = items.get(i);
IExchangeItem item = items.get(i);
String id = item.getId();
this.Ids[i] = id.trim();
int n = 1;
Expand Down
7 changes: 3 additions & 4 deletions algorithms/java/src/org/openda/algorithms/BFGS.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@
package org.openda.algorithms;

import org.openda.interfaces.*;
import org.openda.utils.Results;
import org.openda.utils.ConfigTree;
import org.openda.utils.Instance;
import org.openda.utils.Vector;
import org.openda.utils.Results;
import org.openda.utils.io.CalRestartSettings;
import org.openda.utils.ConfigTree;

import java.io.File;

Expand All @@ -44,7 +43,7 @@ public class BFGS extends Instance implements IAlgorithm {
private IStochModelFactory stochModelFactory;
protected ConfigTree bfgsConf;

private IStochModelInstance bestEstimate = null;
protected IStochModelInstance bestEstimate = null;

private SimulationKwadraticCostFunctionWithGradient J=null;
private PreconditionedCostFunctionWithGradient Jc=null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public abstract class BaseDudCoreOptimizer {
public boolean add_constraints = false;
public String lower = null;
public String upper = null;
private double[] stdValues;

protected int numberOfSearchDirections() {
IStochVector parameterUncertainty = f.getParameterUncertainty();
Expand Down Expand Up @@ -1004,7 +1005,8 @@ void next() {

// now make this pretty for treeVectors
IVector stdWithStructure = pTry.clone();
stdWithStructure.setValues(std.getValues());
stdValues = std.getValues();
stdWithStructure.setValues(stdValues);
Results.putMessage("Error estimate for this outer iteration");
Results.putValue( "parameterErrorEstimateStd", stdWithStructure, stdWithStructure.getSize(),
"outer iteration "+imain, IResultWriter.OutputLevel.Verbose,
Expand Down Expand Up @@ -1141,5 +1143,9 @@ public IVector[] getPredCurrent() {
}
return result;
}

public double[] getStdValues() {
return stdValues;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@
package org.openda.algorithms;

import org.openda.interfaces.*;
import org.openda.utils.Results;
import org.openda.utils.ConfigTree;
import org.openda.utils.Instance;
import org.openda.utils.Vector;
import org.openda.utils.Results;
import org.openda.utils.io.CalRestartSettings;
import org.openda.utils.ConfigTree;

import java.io.File;

Expand All @@ -44,7 +43,7 @@ public class ConjugateGradient extends Instance implements IAlgorithm {
private IStochModelFactory stochModelFactory;
protected ConfigTree conjugateGradientConf;

private IStochModelInstance bestEstimate = null;
protected IStochModelInstance bestEstimate = null;

private SimulationKwadraticCostFunctionWithGradient J=null;
private PreconditionedCostFunctionWithGradient Jc=null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* along with OpenDA. If not, see <http://www.gnu.org/licenses/>.
*/
package org.openda.algorithms;
import org.openda.interfaces.IPrevExchangeItem;
import org.openda.interfaces.IExchangeItem;
import org.openda.interfaces.IObservationDescriptions;
import org.openda.interfaces.IStochObserver;
import org.openda.observers.DischargeDependentSelector;
Expand Down Expand Up @@ -77,13 +77,13 @@ public ObservationSpace applyFilter(ObservationSpace input) {

private void stopIfNoSelectedData(IStochObserver observer) {
IObservationDescriptions descr = observer.getObservationDescriptions();
List<IPrevExchangeItem> items;
List<IExchangeItem> items;
try{
items = descr.getExchangeItems();
}catch (Exception e) {
items = new ArrayList<IPrevExchangeItem>(); //Empty list
items = new ArrayList<IExchangeItem>(); //Empty list
}
for(IPrevExchangeItem item : items){ // assume the exchangeItems are in the
for(IExchangeItem item : items){ // assume the exchangeItems are in the
String id = item.getId();
double times[] = item.getTimes();
if (times == null) {
Expand Down Expand Up @@ -143,11 +143,11 @@ public void initialize(File workingDir, String[] arguments) {
}

private void logObservationSpace(ObservationSpace observationSpace) throws IOException {
List<IPrevExchangeItem> observationItems =
List<IExchangeItem> observationItems =
observationSpace.observer.getObservationDescriptions().getExchangeItems();
String idLine = "obs.EI id's/size";
List<Double> obsValues = new ArrayList<Double>();
for (IPrevExchangeItem exchangeItem : observationItems) {
for (IExchangeItem exchangeItem : observationItems) {
double[] eiValues = exchangeItem.getValuesAsDoubles();
idLine += "," + exchangeItem.getId() + "=" + eiValues.length;
for (double eiValue : eiValues) {
Expand Down
2 changes: 1 addition & 1 deletion algorithms/java/src/org/openda/algorithms/GLUE.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class GLUE extends Instance implements IAlgorithm {
private IStochModelFactory stochModelFactory;
protected ConfigTree glueConf;

private IStochModelInstance bestEstimate = null;
protected IStochModelInstance bestEstimate = null;
private IStochObserver stochObserver = null;
private IVector pInit=null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class GriddedFullSearch extends Instance implements IAlgorithm {
private IStochModelFactory stochModelFactory;
protected ConfigTree gfsConf;

private IStochModelInstance bestEstimate = null;
protected IStochModelInstance bestEstimate = null;
private IStochObserver stochObserver = null;

private SimulationKwadraticCostFunction J=null;
Expand Down
2 changes: 1 addition & 1 deletion algorithms/java/src/org/openda/algorithms/Powell.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class Powell extends Instance implements IAlgorithm {
private IStochModelFactory stochModelFactory;
protected ConfigTree powellConf;

private IStochModelInstance bestEstimate = null;
protected IStochModelInstance bestEstimate = null;

private SimulationKwadraticCostFunction J=null;
private PowellCoreOptimizer powellOptimizer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,15 +383,15 @@ public double evaluate(IVector p, String context) {
private IVector removeBias(IStochObserver obsSelection, IVector lastPredicted) {
IVector prd = lastPredicted.clone();
IObservationDescriptions descr = obsSelection.getObservationDescriptions();
List<IPrevExchangeItem> items;
List<IExchangeItem> items;
try{
items = (List<IPrevExchangeItem>) descr.getExchangeItems();
items = (List<IExchangeItem>) descr.getExchangeItems();
}catch (Exception e) {
throw new RuntimeException("No observation data is available.");
}
int firstIndex=0;
int lastIndex;
for(IPrevExchangeItem item : items){
for(IExchangeItem item : items){
String id = item.getId();
double times[] = item.getTimes();
if (times == null) {
Expand Down
3 changes: 1 addition & 2 deletions algorithms/java/src/org/openda/algorithms/SCE.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.openda.utils.io.CalRestartSettings;

import java.io.File;
import java.util.ArrayList;
import java.util.Random;


Expand All @@ -44,7 +43,7 @@ public class SCE extends Instance implements IAlgorithm {
private IStochModelFactory stochModelFactory;
protected ConfigTree sceConf;

private IStochModelInstance bestEstimate = null;
protected IStochModelInstance bestEstimate = null;
//config
public double initStep=1.0; //scaling factor for initial perturbations of parameters
//workspace
Expand Down
4 changes: 2 additions & 2 deletions algorithms/java/src/org/openda/algorithms/Simplex.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ public class Simplex extends Instance implements IAlgorithm {
private IStochModelFactory stochModelFactory;
protected ConfigTree simplexConf;

private IStochModelInstance bestEstimate = null;
protected IStochModelInstance bestEstimate = null;
//config
public double initStep=1.0; //scaling factor for initial perturbations of parameters
//workspace
private SimulationKwadraticCostFunction J=null;
private SimplexCoreOptimizer simplexOptimizer = null;
protected SimplexCoreOptimizer simplexOptimizer = null;

private File workingDir=null;
private String[] arguments=null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@ public class SimplexCoreOptimizer{
//stopping
private boolean moreToDo = true; // is this optimization finished
private int imain=0; // main iterations done
private double[] stdValues;


/**
/**
* Constructor for Simplex minimization
* @param f : cost function to be minimized
*/
Expand Down Expand Up @@ -475,7 +476,8 @@ void next(){
std.sqrt();
// now make this pretty for treeVectors
IVector stdWithStructure = this.pCurrent[0].clone();
stdWithStructure.setValues(std.getValues());
stdValues = std.getValues();
stdWithStructure.setValues(stdValues);
Results.putMessage("Error estimate for this outer iteration");
Results.putValue( "parameterErrorEstimateStd", stdWithStructure, stdWithStructure.getSize(),
"outer iteration "+imain, IResultWriter.OutputLevel.Verbose,
Expand Down Expand Up @@ -589,4 +591,7 @@ private IVector vectorSum(IVector[] vs){
return result;
}

public double[] getStdValues() {
return stdValues;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -462,13 +462,13 @@ private void logDebugInfo(String modelInstanceName, IStochObserver observationSe
// Add model instance identifier to evaluation
String message = "Evaluation:," + numberEvaluation + "," + modelInstanceName;
debugFileWriter.write(message + "\n");
List<IPrevExchangeItem> observationItems =
List<IExchangeItem> observationItems =
observationSelection.getObservationDescriptions().getExchangeItems();
debugFileWriter.write("obs.id's,size,startIndex\n");
List<Double> obsValues = new ArrayList<Double>();
List<Double> obsTimes = new ArrayList<Double>();
int startIndex = 1;
for (IPrevExchangeItem exchangeItem : observationItems) {
for (IExchangeItem exchangeItem : observationItems) {
double[] eiValues = exchangeItem.getValuesAsDoubles();
double[] eiTimes = exchangeItem.getTimes();
debugFileWriter.write(exchangeItem.getId() + "," + eiValues.length + "," + startIndex + "\n");
Expand Down Expand Up @@ -508,15 +508,15 @@ private void logDebugInfo(String modelInstanceName, IStochObserver observationSe
private IVector removeBias(IStochObserver obsSelection, IVector lastPredicted) {
IVector prd = lastPredicted.clone();
IObservationDescriptions descr = obsSelection.getObservationDescriptions();
List<IPrevExchangeItem> items;
List<IExchangeItem> items;
try{
items = descr.getExchangeItems();
}catch (Exception e) {
throw new RuntimeException("No observation data is available through the exchangeItems.");
}
int firstIndex=0;
int lastIndex;
for(IPrevExchangeItem item : items){
for(IExchangeItem item : items){
String id = item.getId();
double times[] = item.getTimes();
if (times == null) {
Expand Down Expand Up @@ -555,15 +555,15 @@ private IVector removeBias(IStochObserver obsSelection, IVector lastPredicted) {
private IVector removeStd(IStochObserver obsSelection, IVector lastPredicted) {
IVector prd = lastPredicted.clone();
IObservationDescriptions descr = obsSelection.getObservationDescriptions();
List<IPrevExchangeItem> items;
List<IExchangeItem> items;
try{
items = descr.getExchangeItems();
}catch (Exception e) {
throw new RuntimeException("No observation data is available through exchangeItems.");
}
int firstIndex=0;
int lastIndex;
for(IPrevExchangeItem item : items){
for(IExchangeItem item : items){
String id = item.getId();
double times[] = item.getTimes();
if (times == null) {
Expand Down
8 changes: 4 additions & 4 deletions algorithms/java/src/org/openda/algorithms/SparseDud.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ private int[][] findNonZeros( boolean verbose) {
}

ConfigTree[] subTrees = configtree.getSubTrees("dependencies/obs");
List<IPrevExchangeItem> exchangeItems = stochObserver.getObservationDescriptions().getExchangeItems();
List<IExchangeItem> exchangeItems = stochObserver.getObservationDescriptions().getExchangeItems();
checkDependenciesForAllExchangeItems(subTrees, exchangeItems);

boolean[] allParsFound = new boolean[npar];
Expand Down Expand Up @@ -97,7 +97,7 @@ private int[][] findNonZeros( boolean verbose) {
if ( predFound==0) {
String allObservations="";
if (exchangeItems != null) {
for (IPrevExchangeItem exchangeItem : exchangeItems) {
for (IExchangeItem exchangeItem : exchangeItems) {
allObservations += "\t'" + exchangeItem.getId() + "'\n";
}
} else {
Expand Down Expand Up @@ -150,9 +150,9 @@ private void checkDependenciesForAllParameters(ArrayList<String> parameterNames,
throw new RuntimeException(parsNotFound + " parameter(s) found without any dependency");
}

private void checkDependenciesForAllExchangeItems(ConfigTree[] subTrees, List<IPrevExchangeItem> exchangeItems) {
private void checkDependenciesForAllExchangeItems(ConfigTree[] subTrees, List<IExchangeItem> exchangeItems) {
boolean anyExchangeItemNotFound = false;
for (IPrevExchangeItem exchangeItem : exchangeItems) {
for (IExchangeItem exchangeItem : exchangeItems) {
String exchangeItemId = exchangeItem.getId();
boolean exchangeItemFound = false;
for (ConfigTree subTree : subTrees) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ private MinimalObservationDescriptions(double x, double y) {
this.y = y;
}

public List<IPrevExchangeItem> getExchangeItems() {
public List<IExchangeItem> getExchangeItems() {
throw new UnsupportedOperationException(getClass().getName() + ".getExchangeItems() not implemented.");
}

Expand Down
Loading