Esempio n. 1
0
			'maxls':10,
			'finite_diff_rel_step':None
		}

		}
	elif args.solver == 'GlobalBestPSO':
		kwargs = {
		# 'x0': utils.get_random_x0((300,20), -5.12, 5.12),
		'x0': utils.get_static_x0((300,20), -5.12, 5.12, seed=3.0),
		'dimensions':20,
		'bounds': np.full((20,2), (-5.12,5.12)),
		'maxiter': 3000,   #2750
		'n_particles':300,

		'options': {'c1':0.3,'c2': 0.65, 'w' : 0.95},
		'pso_kwargs': {'bh_strategy' : 'periodic',
						'velocity_clamp' : None,
						'vh_strategy' : 'unmodified',
						'center' : 1.0,
						'ftol' : 1e-15,
						'ftol_iter' : 3
						}
		}

	if args.trace:
		utils.run_with_callgraph(cfg.main, RastriginDigitalTwin(), args, kwargs)
	else:
		cfg.main(RastriginDigitalTwin(), args, kwargs)


Esempio n. 2
0
     'maxiter':
     10000,
     'restart_temp_ratio':
     restart_temp,
     'visit':
     visit,
     'accept':
     accept,
     'maxfun':
     100000,
     'no_local_search':
     True,
     'seed':
     20
 }
 app = (cfg.main(RosenbrockDigitalTwin(), args, kwargs))
 intermitentData = intermitentData.append(
     {
         'solver': '-------------------Default Parameters----------------',
     },
     ignore_index=True)
 intermitentData = intermitentData.append(
     {
         'solver': 'dual_annealing',
         '#DV': 50,
         'initial_temp': kwargs['initial_temp'],
         'accept': kwargs['accept'],
         'visit': kwargs['visit'],
         'restart_temp_ratio': kwargs['restart_temp_ratio'],
         'no_local_search': kwargs['no_local_search'],
         'fun': app.fun,
Esempio n. 3
0
			'gtol':1e-15,
			'eps':0.1,
			'maxfun':10000,
			'maxls':10,
			'finite_diff_rel_step':None
		}

		}

	elif args.solver == 'GlobalBestPSO':
		kwargs = {
		'x0': utils.get_static_x0((400,21), -5, 10),
		'dimensions':21,
		'bounds': np.full((21,2), (-5, 10)),
		'maxiter':3500,
		'n_particles':400,
		'options': {'c1':0.5,'c2': 0.7, 'w' : 0.9},
		'pso_kwargs': {'bh_strategy' : 'periodic',
						'velocity_clamp' : None,
						'ftol_iter':3,
						'vh_strategy' : 'unmodified',
						'center' : 1.0,
						'ftol' : 1e-1
						}
		}

	if args.trace:
		utils.run_with_callgraph(cfg.main, RosenbrockDigitalTwin(), args, kwargs)
	else:
		print(cfg.main(RosenbrockDigitalTwin(), args, kwargs))