xxxxxxxxxx
Install SMOP:
$ git clone https://github.com/victorlei/smop
$ cd smop
$ python setup.py install --user
then run:
$ smop file.m
this will convert file.m in file.py
xxxxxxxxxx
'''
Hi I did this but I have found the following error
can someone guide me to how to solve it
'''
(kinetics) PS E:\code\Cantera\conversion\input> smop poly_cp.m
C:\Users\fahad\anaconda3\envs\kinetics\lib\site-packages\ply\lex.py:760: FutureWarning: Possible nested set at position 65
c = re.compile('(?P<%s>%s)' % (fname, _get_regex(f)), self.reflags)
C:\Users\fahad\anaconda3\envs\kinetics\lib\site-packages\ply\lex.py:498: FutureWarning: Possible nested set at position 118
lexre = re.compile(regex, reflags)
str
Traceback (most recent call last):
File "C:\Users\fahad\anaconda3\envs\kinetics\lib\site-packages\smop\main.py", line 66, in main
G = resolve.resolve(stmt_list)
File "C:\Users\fahad\anaconda3\envs\kinetics\lib\site-packages\smop\resolve.py", line 54, in resolve
u = G.node[n]["ident"]
AttributeError: 'DiGraph' object has no attribute 'node'
Errors: 1
xxxxxxxxxx
% Grey Wolf Optimizer
function [Alpha_score,Alpha_pos,Convergence_curve]=GWO(SearchAgents_no,Max_iter,lb,ub,dim,fobj)
% initialize alpha, beta, and delta_pos
Alpha_pos=zeros(1,dim);
Alpha_score=inf; %change this to -inf for maximization problems
Beta_pos=zeros(1,dim);
Beta_score=inf; %change this to -inf for maximization problems
_
xxxxxxxxxx
Delta_pos=zeros(1,dim);
Delta_score=inf; %change this to -inf for maximization problems
%Initialize the positions of search agents
Positions=initialization(SearchAgents_no,dim,ub,lb);
Convergence_curve=zeros(1,Max_iter);
velocity = .3*randn(SearchAgents_no,dim) ;
w=0.5+rand()/2;
l=0;% Loop counter
% Main loop
while l<Max_iter
for i=1:size(Positions,1)
% Return back the search agents that go beyond the boundaries of the search space
Flag4ub=Positions(i,:)>ub;
Flag4lb=Positions(i,:)<lb;
Positions(i,:)=(Positions(i,:).*(~(Flag4ub+Flag4lb)))+ub.*Flag4ub+lb.*Flag4lb;
% Calculate objective function for each search agent
fitness=fobj(Positions(i,:));
xxxxxxxxxx
% Update Alpha, Beta, and Delta
if fitness<Alpha_score
Alpha_score=fitness; % Update alpha
Alpha_pos=Positions(i,:);
end
if fitness>Alpha_score && fitness<Beta_score
Beta_score
xxxxxxxxxx
rgbInputImage = imread('peppers.png');
labInputImage = applycform(rgbInputImage,makecform('srgb2lab'));
Lbpdfhe = fcnBPDFHE(labInputImage(:,:,1));
labOutputImage = cat(3,Lbpdfhe,labInputImage(:,:,2),labInputImage(:,:,3));
rgbOutputImage = applycform(labOutputImage,makecform('lab2srgb'));