Skip to content

Commit f63be50

Browse files
committed
'0306'
1 parent 894eb26 commit f63be50

10 files changed

Lines changed: 206 additions & 97 deletions

File tree

UQPyL/problem/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def __init__(self, nInput:int, nOutput:int,
5454
self.idxF = np.where(self.varType == 0)[0]
5555
self.idxI = np.where(self.varType == 1)[0]
5656
self.idxD = np.where(self.varType == 2)[0]
57-
57+
5858
# Set variable sets for discrete variables
5959
if varSet is None:
6060
self.varSet = {}

model/APEX/cost.py

Lines changed: 0 additions & 10 deletions
This file was deleted.

model/APEX/ds_param.yaml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,4 @@
11
design_parameters:
2-
- name: CHN
3-
type: float
4-
mode: v
5-
bounds: [0.015, 0.15]
6-
cache: True
7-
8-
9-
- name: SOL_K
10-
type: float
11-
mode: v
12-
bounds: [0.0001, 10]
13-
cache: True
14-
152
- name: GWSO
163
type: float
174
mode: v

model/APEX/ds_param_quality.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
design_parameters:
2+
- name: PRAM7
3+
type: float
4+
mode: v
5+
bounds: [0, 1]
6+
cache: True
7+
8+
- name: PRAM8
9+
type: float
10+
mode: v
11+
bounds: [10, 20]
12+
cache: True
13+
14+
- name: PRAM14
15+
type: float
16+
mode: v
17+
bounds: [0.1, 1]
18+
cache: True
19+
20+
- name: PRAM35
21+
type: float
22+
mode: v
23+
bounds: [0.9, 1.1]
24+
cache: True
25+
26+
- name: PRAM54
27+
type: float
28+
mode: v
29+
bounds: [0.3, 0.9]
30+
cache: True
31+
32+
- name: PRAM55
33+
type: float
34+
mode: v
35+
bounds: [0.1, 0.3]
36+
cache: True
37+
38+
- name: PRAM57
39+
type: float
40+
mode: v
41+
bounds: [0.05, 2.0]
42+
cache: True
43+
44+
- name: PRAM58
45+
type: float
46+
mode: v
47+
bounds: [0.3, 0.9]
48+
cache: True
49+
50+
- name: PRAM59
51+
type: float
52+
mode: v
53+
bounds: [1, 20]
54+
cache: True
55+
56+
- name: PRAM72
57+
type: float
58+
mode: v
59+
bounds: [0.05, 0.5]
60+
cache: True

model/APEX/paraLibrary.yaml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,3 +331,102 @@ parameter_library:
331331
precision: 2
332332
maxNum: 10
333333

334+
- name: PRAM7
335+
type: float
336+
bounds: [0, 1]
337+
file:
338+
name: "PARM1501.DAT"
339+
line: 31
340+
start: 49
341+
width: 8
342+
precision: 2
343+
344+
- name: PRAM8
345+
type: float
346+
bounds: [10, 20]
347+
file:
348+
name: "PARM1501.DAT"
349+
line: 31
350+
start: 57
351+
width: 8
352+
precision: 2
353+
354+
- name: PRAM14
355+
type: float
356+
bounds: [0.1, 1]
357+
file:
358+
name: "PARM1501.DAT"
359+
line: 32
360+
start: 25
361+
width: 8
362+
precision: 2
363+
364+
- name: PRAM35
365+
type: float
366+
bounds: [0.9, 1.1]
367+
file:
368+
name: "PARM1501.DAT"
369+
line: 34
370+
start: 33
371+
width: 8
372+
precision: 2
373+
374+
- name: PRAM54
375+
type: float
376+
bounds: [0.3, 0.9]
377+
file:
378+
name: "PARM1501.DAT"
379+
line: 36
380+
start: 25
381+
width: 8
382+
precision: 2
383+
384+
- name: PRAM55
385+
type: float
386+
bounds: [0.1, 0.3]
387+
file:
388+
name: "PARM1501.DAT"
389+
line: 36
390+
start: 33
391+
width: 8
392+
precision: 2
393+
394+
- name: PRAM57
395+
type: float
396+
bounds: [0.05, 2.0]
397+
file:
398+
name: "PARM1501.DAT"
399+
line: 36
400+
start: 49
401+
width: 8
402+
precision: 2
403+
404+
- name: PRAM58
405+
type: float
406+
bounds: [0.3, 0.9]
407+
file:
408+
name: "PARM1501.DAT"
409+
line: 36
410+
start: 57
411+
width: 8
412+
precision: 2
413+
414+
- name: PRAM59
415+
type: float
416+
bounds: [1, 20]
417+
file:
418+
name: "PARM1501.DAT"
419+
line: 36
420+
start: 65
421+
width: 8
422+
precision: 2
423+
424+
- name: PRAM72
425+
type: float
426+
bounds: [0.05, 0.5]
427+
file:
428+
name: "PARM1501.DAT"
429+
line: 38
430+
start: 9
431+
width: 8
432+
precision: 2

model/APEX/runoff.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: general
22

33
basic:
4-
projectPath: "E:/apex_bian/TxtInOut/TxtInOut"
4+
projectPath: "E:/apex_bian/hhapex"
55
workPath: "E:/Apex_workPath"
66
command: "APEX1501_rel32.exe"
77
timeout: 120

model/APEX/sim_model.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,13 @@ def evaluate(self, X):
9494
for cte in records:
9595
i = cte['i']
9696
if 'error' in cte:
97-
objs[i, :] = np.inf #TODO
97+
objs[i, :] = -1 * np.inf #TODO
9898
else:
9999
for j, obj_id in enumerate(self.cfg.objectives.use):
100100
if np.isnan(cte[obj_id]):
101-
objs[i, j] = np.inf
101+
objs[i, j] = -1 * np.inf #TODO
102102
else:
103103
objs[i, j] = cte[obj_id]
104-
105104
return objs
106105

107106
def _subprocess(self, X, i, batch_id):

model/APEX/temp.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import numpy as np
2+
3+
def transform_tn(runoff, tn):
4+
5+
return tn/runoff/30/86.4

model/APEX/temp_apex.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,39 @@
55

66
apex = SimModel(cfgPath)
77

8-
from UQPyL.analysis import FAST
8+
# from UQPyL.analysis import FAST
99

10-
fast = FAST()
10+
# fast = FAST()
1111

12-
X = fast.sample(apex, 200)
12+
# X = fast.sample(apex, 200)
1313

14-
Y = apex.evaluate(X)
15-
16-
res = fast.analyze(apex, X, Y)
14+
# Y = apex.evaluate(X)
1715

16+
# res = fast.analyze(apex, X, Y)
1817

1918
# from UQPyL.doe import LHS
2019

2120
# lhs = LHS()
22-
# X = lhs.sample(apex, 10)
21+
22+
# X = lhs.sample(apex, 100)
23+
24+
# Y = apex.evaluate(X)
2325

2426
# X = np.array([57.16922, 257.69545, 30,8.25605,0.56604,0.49416,0.3356,0.00264,0.58426,2.37038,0.96653,4.52535,0.1508,2.78543,1.56767,2.39188,0.28602,2.43478,0.18024,0.01597,0.35966,0.66535,0.29489,0.40602,0.88983,1.29701,1.84515,1.16646,0.96171,23.95696,0.02732
2527
# ]).reshape(1, -1)
2628

27-
# X = np.array([41.8007,268.02091,46, 7.48015,0.55689,0.32735,0.8633,
28-
# 0.00258,0.56848,0.53609,0.24591,5.37041,0.2058,4.86825,
29-
# 1.39641,1.65329,0.1022,2.78815,0.09235,0.09426,0.43786,
30-
# 0.95824,0.80292,0.15364,0.74659,1.02759,1.70902,1.85659,
31-
# 0.70676,19.63727,0.02913]).reshape(1, -1)
29+
X = np.array([41.8007,268.02091,46, 7.48015,0.55689,0.32735,0.8633,
30+
0.00258,0.56848,0.53609,0.24591,5.37041,0.2058,4.86825,
31+
1.39641,1.65329,0.1022,2.78815,0.09235,0.09426,0.43786,
32+
0.95824,0.80292,0.15364,0.74659,1.02759,1.70902,1.85659,
33+
0.70676,19.63727,0.02913]).reshape(1, -1)
3234

3335

3436
# NAN
3537
# X = np.array([106.4941451,56.52897001,16,7.650724319,0.566819315,-2.012317419,0,0.002844311,0.570308047,1.405164043,0.320546075,0,0.117799496,5,1.277088966,1.947140682,0.149834391,3.433962163,0.621833414,0,0.5,1.264346194,1,0.283813824,1.434990511,1,0.1,0.532676437,0,22.84456183,0.038962775
3638
# ]).reshape(1, -1)
3739

3840

39-
# objs = apex.evaluate(X)
41+
objs = apex.evaluate(X)
4042

41-
# a = 1
43+
a = 1

0 commit comments

Comments
 (0)