남녀 소개팅 미팅 프로그램
키클
function match=stablematching(mpref,wpref)propositionmat=false(size(mpref));
match=zeros(size(msingle));
while any(msingle) && ~all(all(propositionmat))
idxm=find(msingle);
x=randi(length(idxm),1);
choosenm=idxm(x);
notproposed=(propositionmat(choosenm,:)==false);
bestmatch=max(mpref(choosenm,notproposed));
msfavoritew=find(mpref(choosenm,:)==bestmatch);
if wsingle(msfavoritew)==true
wsingle(msfavoritew)=false;
msingle(choosenm)=false;
match(choosenm)=msfavoritew;
propositionmat(choosenm,msfavoritew)=true;
else
otherm=find(match==msfavoritew);
propositionmat(choosenm,msfavoritew)=true;
if wpref(otherm,msfavoritew)wpref(choosenm,msfavoritew)
msingle(choosenm)=false;
msingle(otherm)=true;
match(otherm)=0;
match(choosenm)=msfavoritew;
end
end
end
이게 matlab파일에서 추출한 코드인데요
이것을 자바로 바꿔서 프로그램을 실행시키는방법을 모르겠어요 ㅠㅠ
수다님들 좀 가르쳐주세요 ㅠㅠ