Skip to content

Commit

Permalink
Fixed search
Browse files Browse the repository at this point in the history
  • Loading branch information
LebedevIlyaG committed Nov 23, 2023
1 parent 26b4128 commit e91ab4a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion iOpt/method/grid_search_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,6 @@ def calculate_global_r(self, curr_point: SearchDataItem, left_point: SearchDataI

deltax = curr_point.delta

global_r = 2 * deltax
global_r = deltax

curr_point.globalR = global_r
27 changes: 14 additions & 13 deletions iOpt/method/search_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,19 +372,20 @@ def save_progress(self, file_name: str):
'functionID': str(fv.functionID),
})

data['SearchDataItem'].append({
'float_variables': list(dataItem.get_y().float_variables),
'discrete_variables': [] if dataItem.get_y().discrete_variables is None else list(
dataItem.get_y().discrete_variables),
'function_values': list(fvs),
'x': dataItem.get_x(),
'delta': dataItem.delta,
'globalR': dataItem.globalR,
'localR': dataItem.localR,
'index': dataItem.get_index(),
'discrete_value_index': dataItem.get_discrete_value_index(),
'__z': dataItem.get_z()
})
if np.isfinite(dataItem.get_z()):
data['SearchDataItem'].append({
'float_variables': list(dataItem.get_y().float_variables),
'discrete_variables': [] if dataItem.get_y().discrete_variables is None else list(
dataItem.get_y().discrete_variables),
'function_values': list(fvs),
'x': dataItem.get_x(),
'delta': dataItem.delta,
'globalR': dataItem.globalR,
'localR': dataItem.localR,
'index': dataItem.get_index(),
'discrete_value_index': dataItem.get_discrete_value_index(),
'__z': dataItem.get_z()
})

data['best_trials'] = [] # создаем список
dataItem = self.solution.best_trials[0]
Expand Down

0 comments on commit e91ab4a

Please sign in to comment.