Skip to content

Commit

Permalink
Change lib name
Browse files Browse the repository at this point in the history
  • Loading branch information
dhadka committed Dec 31, 2023
1 parent b1bf5a7 commit 6f7c298
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions native/Radar/bin/startEval.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function [] = startEval(nvars, nobjs, ncons, functionHandle, port)

if ~libisloaded('libmoeaframework')
loadlibrary('libmoeaframework', 'moeamatlab.h');
if ~libisloaded('moeaframework')
loadlibrary('moeaframework', 'moeamatlab.h');
end

if (isa(functionHandle, 'function_handle'))
Expand All @@ -17,22 +17,22 @@
end

disp('Waiting for connection...');
calllib('libmoeaframework', 'MOEA_Init_socket', nobjs, ncons, port);
calllib('moeaframework', 'MOEA_Init_socket', nobjs, ncons, port);
disp('Connection established...');

while strcmp(calllib('libmoeaframework', 'MOEA_Next_solution'), 'MOEA_SUCCESS')
while strcmp(calllib('moeaframework', 'MOEA_Next_solution'), 'MOEA_SUCCESS')
vars = zeros(1, nvars);
pvars = libpointer('doublePtr', vars);
calllib('libmoeaframework', 'MOEA_Read_doubles', nvars, pvars);
calllib('moeaframework', 'MOEA_Read_doubles', nvars, pvars);
vars = get(pvars, 'Value');

[objs, cons] = functionHandle(vars);

pobjs = libpointer('doublePtr', objs);
pcons = libpointer('doublePtr', cons);
calllib('libmoeaframework', 'MOEA_Write', pobjs, pcons);
calllib('moeaframework', 'MOEA_Write', pobjs, pcons);
end

calllib('libmoeaframework', 'MOEA_Terminate');
calllib('moeaframework', 'MOEA_Terminate');
disp('Shutting down...');
exit

0 comments on commit 6f7c298

Please sign in to comment.