Skip to content

Instantly share code, notes, and snippets.

@Sultan91
Created June 22, 2018 09:22
Show Gist options
  • Save Sultan91/37bf661c11a8f4d89499dcf9fe2b4ab4 to your computer and use it in GitHub Desktop.
Save Sultan91/37bf661c11a8f4d89499dcf9fe2b4ab4 to your computer and use it in GitHub Desktop.
Reward function that aimed to save power and stay within temperature limits
function [ err ] = rewardFunc_test( setpointT, actualT, power, constraint)
low = constraint(1);
high = constraint(2);
if (actualT>low & actualT<high)
err = -(abs(setpointT - actualT))^2 - power/100;
else
err = -(abs(setpointT - actualT))^2 -1000- power/100;
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment