Programa
Programa
using System.Linq;
using System.Collections.Generic;
using HeuristicLab.Common;
using HeuristicLab.Core;
using HeuristicLab.Data;
using HeuristicLab.Encodings.BinaryVectorEncoding;
using HeuristicLab.Encodings.IntegerVectorEncoding;
using HeuristicLab.Encodings.RealVectorEncoding;
using HeuristicLab.Encodings.PermutationEncoding;
using HeuristicLab.Encodings.LinearLinkageEncoding;
using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
using HeuristicLab.Optimization;
using HeuristicLab.Problems.Programmable;
namespace HeuristicLab.Problems.Programmable {
public class CompiledSingleObjectiveProblemDefinition : CompiledProblemDefinition,
ISingleObjectiveProblemDefinition {
public bool Maximization { get { return false; } }
//Definición de funciones
var M=F*(L+0.5*l);
var R=Math.Sqrt(Math.Pow(0.5*l,2) +Math.Pow((0.5*t+0.5*h),2));
var J=1.414*h*l*(0.08333*Math.Pow(l,2) + Math.Pow((0.5*t+0.5*h),2));
var t1=(0.70711*F)/(h*l);
var t2=(M*R)/J;
var cos_theta=l/(2*R);
var sx=(6*F*L)/(b*Math.Pow(t,2));
var tx=Math.Sqrt(Math.Pow(t1,2)+(2*t1*t2*cos_theta)+Math.Pow(t2,2));
//Restricciones
var g1=0;var g2=0;var g3=0;var g4=0;var g5=0;var g6=0;
//Función de calidad
var costo=(1.13*(Math.Pow(h,2))*l) + (0.08*t*b*(L+l)) + g1 + g2 + g3 + g4 + g5 + g6;
return costo;
}