nudge 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +5 -0
- data/LICENSE.txt +21 -0
- data/Rakefile +23 -0
- data/VERSION +1 -0
- data/_spikes/couch_document_spike.rb +24 -0
- data/_spikes/nested_parsing/nested.rb +0 -0
- data/_spikes/nested_parsing/nested.treetop +6 -0
- data/_spikes/nudgeview/init.rb +19 -0
- data/_spikes/nudgeview/public/javascripts/app.js +12 -0
- data/_spikes/nudgeview/public/javascripts/jquery.js +4376 -0
- data/_spikes/nudgeview/public/javascripts/jquery.svg.js +1325 -0
- data/_spikes/nudgeview/views/index.erb +18 -0
- data/_spikes/nudgeview/views/index.haml +8 -0
- data/_spikes/simplestWeb/simplest.rb +44 -0
- data/_spikes/simplestWeb/views/main.erb +19 -0
- data/_spikes/sketches/nudgecode_spike.rb +146 -0
- data/_spikes/sketches/searchDSL_spike.rb +25 -0
- data/_spikes/sketches/search_operator_sketch_spike.txt +287 -0
- data/_spikes/sketches/searchspace_spike.rb +96 -0
- data/_spikes/symbolic_regression/activate.rb +35 -0
- data/_spikes/symbolic_regression/config/environment.rb +340 -0
- data/_spikes/symbolic_regression/config/environments/deployment.rb +0 -0
- data/_spikes/symbolic_regression/config/environments/development.rb +0 -0
- data/_spikes/symbolic_regression/experiment/objectives/programLength.rb +2 -0
- data/_spikes/symbolic_regression/experiment/objectives/summedSquaredError.rb +2 -0
- data/_spikes/symbolic_regression/lib/tasks/run.rake +0 -0
- data/doc/classes/BlockNode.html +146 -0
- data/doc/classes/BlockNode.src/M000246.html +18 -0
- data/doc/classes/BoolAndInstruction.html +218 -0
- data/doc/classes/BoolAndInstruction.src/M000003.html +15 -0
- data/doc/classes/BoolAndInstruction.src/M000004.html +16 -0
- data/doc/classes/BoolAndInstruction.src/M000005.html +15 -0
- data/doc/classes/BoolAndInstruction.src/M000006.html +15 -0
- data/doc/classes/BoolEqualQInstruction.html +218 -0
- data/doc/classes/BoolEqualQInstruction.src/M000015.html +15 -0
- data/doc/classes/BoolEqualQInstruction.src/M000016.html +16 -0
- data/doc/classes/BoolEqualQInstruction.src/M000017.html +15 -0
- data/doc/classes/BoolEqualQInstruction.src/M000018.html +15 -0
- data/doc/classes/BoolFromFloatInstruction.html +218 -0
- data/doc/classes/BoolFromFloatInstruction.src/M000071.html +15 -0
- data/doc/classes/BoolFromFloatInstruction.src/M000072.html +15 -0
- data/doc/classes/BoolFromFloatInstruction.src/M000073.html +15 -0
- data/doc/classes/BoolFromFloatInstruction.src/M000074.html +15 -0
- data/doc/classes/BoolFromIntInstruction.html +218 -0
- data/doc/classes/BoolFromIntInstruction.src/M000067.html +15 -0
- data/doc/classes/BoolFromIntInstruction.src/M000068.html +15 -0
- data/doc/classes/BoolFromIntInstruction.src/M000069.html +15 -0
- data/doc/classes/BoolFromIntInstruction.src/M000070.html +15 -0
- data/doc/classes/BoolNotInstruction.html +218 -0
- data/doc/classes/BoolNotInstruction.src/M000019.html +15 -0
- data/doc/classes/BoolNotInstruction.src/M000020.html +15 -0
- data/doc/classes/BoolNotInstruction.src/M000021.html +15 -0
- data/doc/classes/BoolNotInstruction.src/M000022.html +15 -0
- data/doc/classes/BoolOrInstruction.html +218 -0
- data/doc/classes/BoolOrInstruction.src/M000007.html +15 -0
- data/doc/classes/BoolOrInstruction.src/M000008.html +16 -0
- data/doc/classes/BoolOrInstruction.src/M000009.html +15 -0
- data/doc/classes/BoolOrInstruction.src/M000010.html +15 -0
- data/doc/classes/BoolRandomInstruction.html +218 -0
- data/doc/classes/BoolRandomInstruction.src/M000187.html +15 -0
- data/doc/classes/BoolRandomInstruction.src/M000188.html +14 -0
- data/doc/classes/BoolRandomInstruction.src/M000189.html +15 -0
- data/doc/classes/BoolRandomInstruction.src/M000190.html +15 -0
- data/doc/classes/BoolType.html +196 -0
- data/doc/classes/BoolType.src/M000240.html +16 -0
- data/doc/classes/BoolType.src/M000241.html +15 -0
- data/doc/classes/BoolType.src/M000242.html +15 -0
- data/doc/classes/BoolXorInstruction.html +218 -0
- data/doc/classes/BoolXorInstruction.src/M000011.html +15 -0
- data/doc/classes/BoolXorInstruction.src/M000012.html +16 -0
- data/doc/classes/BoolXorInstruction.src/M000013.html +15 -0
- data/doc/classes/BoolXorInstruction.src/M000014.html +15 -0
- data/doc/classes/ChannelNode.html +161 -0
- data/doc/classes/ChannelNode.src/M000249.html +15 -0
- data/doc/classes/ChannelNode.src/M000250.html +16 -0
- data/doc/classes/CodeType.html +269 -0
- data/doc/classes/CodeType.src/M000219.html +38 -0
- data/doc/classes/CodeType.src/M000220.html +16 -0
- data/doc/classes/CodeType.src/M000221.html +16 -0
- data/doc/classes/CodeType.src/M000222.html +16 -0
- data/doc/classes/CodeType.src/M000223.html +24 -0
- data/doc/classes/CodeType.src/M000224.html +42 -0
- data/doc/classes/ERCNode.html +183 -0
- data/doc/classes/ERCNode.src/M000254.html +15 -0
- data/doc/classes/ERCNode.src/M000255.html +16 -0
- data/doc/classes/ERCNode.src/M000256.html +16 -0
- data/doc/classes/ExecPopInstruction.html +218 -0
- data/doc/classes/ExecPopInstruction.src/M000075.html +15 -0
- data/doc/classes/ExecPopInstruction.src/M000076.html +14 -0
- data/doc/classes/ExecPopInstruction.src/M000077.html +15 -0
- data/doc/classes/ExecPopInstruction.src/M000078.html +14 -0
- data/doc/classes/FloatAbsInstruction.html +218 -0
- data/doc/classes/FloatAbsInstruction.src/M000107.html +15 -0
- data/doc/classes/FloatAbsInstruction.src/M000108.html +15 -0
- data/doc/classes/FloatAbsInstruction.src/M000109.html +15 -0
- data/doc/classes/FloatAbsInstruction.src/M000110.html +15 -0
- data/doc/classes/FloatAddInstruction.html +218 -0
- data/doc/classes/FloatAddInstruction.src/M000079.html +15 -0
- data/doc/classes/FloatAddInstruction.src/M000080.html +16 -0
- data/doc/classes/FloatAddInstruction.src/M000081.html +15 -0
- data/doc/classes/FloatAddInstruction.src/M000082.html +15 -0
- data/doc/classes/FloatCosineInstruction.html +218 -0
- data/doc/classes/FloatCosineInstruction.src/M000123.html +15 -0
- data/doc/classes/FloatCosineInstruction.src/M000124.html +15 -0
- data/doc/classes/FloatCosineInstruction.src/M000125.html +15 -0
- data/doc/classes/FloatCosineInstruction.src/M000126.html +15 -0
- data/doc/classes/FloatDivideInstruction.html +218 -0
- data/doc/classes/FloatDivideInstruction.src/M000091.html +15 -0
- data/doc/classes/FloatDivideInstruction.src/M000092.html +16 -0
- data/doc/classes/FloatDivideInstruction.src/M000093.html +20 -0
- data/doc/classes/FloatDivideInstruction.src/M000094.html +15 -0
- data/doc/classes/FloatFromBoolInstruction.html +218 -0
- data/doc/classes/FloatFromBoolInstruction.src/M000055.html +15 -0
- data/doc/classes/FloatFromBoolInstruction.src/M000056.html +15 -0
- data/doc/classes/FloatFromBoolInstruction.src/M000057.html +15 -0
- data/doc/classes/FloatFromBoolInstruction.src/M000058.html +15 -0
- data/doc/classes/FloatFromIntInstruction.html +218 -0
- data/doc/classes/FloatFromIntInstruction.src/M000063.html +15 -0
- data/doc/classes/FloatFromIntInstruction.src/M000064.html +15 -0
- data/doc/classes/FloatFromIntInstruction.src/M000065.html +15 -0
- data/doc/classes/FloatFromIntInstruction.src/M000066.html +15 -0
- data/doc/classes/FloatGreaterThanQInstruction.html +218 -0
- data/doc/classes/FloatGreaterThanQInstruction.src/M000035.html +15 -0
- data/doc/classes/FloatGreaterThanQInstruction.src/M000036.html +16 -0
- data/doc/classes/FloatGreaterThanQInstruction.src/M000037.html +15 -0
- data/doc/classes/FloatGreaterThanQInstruction.src/M000038.html +15 -0
- data/doc/classes/FloatIfInstruction.html +218 -0
- data/doc/classes/FloatIfInstruction.src/M000047.html +16 -0
- data/doc/classes/FloatIfInstruction.src/M000048.html +15 -0
- data/doc/classes/FloatIfInstruction.src/M000049.html +14 -0
- data/doc/classes/FloatIfInstruction.src/M000050.html +17 -0
- data/doc/classes/FloatLessThanQInstruction.html +218 -0
- data/doc/classes/FloatLessThanQInstruction.src/M000039.html +15 -0
- data/doc/classes/FloatLessThanQInstruction.src/M000040.html +16 -0
- data/doc/classes/FloatLessThanQInstruction.src/M000041.html +15 -0
- data/doc/classes/FloatLessThanQInstruction.src/M000042.html +15 -0
- data/doc/classes/FloatMaxInstruction.html +218 -0
- data/doc/classes/FloatMaxInstruction.src/M000095.html +15 -0
- data/doc/classes/FloatMaxInstruction.src/M000096.html +16 -0
- data/doc/classes/FloatMaxInstruction.src/M000097.html +15 -0
- data/doc/classes/FloatMaxInstruction.src/M000098.html +15 -0
- data/doc/classes/FloatMinInstruction.html +218 -0
- data/doc/classes/FloatMinInstruction.src/M000099.html +15 -0
- data/doc/classes/FloatMinInstruction.src/M000100.html +16 -0
- data/doc/classes/FloatMinInstruction.src/M000101.html +15 -0
- data/doc/classes/FloatMinInstruction.src/M000102.html +15 -0
- data/doc/classes/FloatMultiplyInstruction.html +218 -0
- data/doc/classes/FloatMultiplyInstruction.src/M000083.html +15 -0
- data/doc/classes/FloatMultiplyInstruction.src/M000084.html +16 -0
- data/doc/classes/FloatMultiplyInstruction.src/M000085.html +15 -0
- data/doc/classes/FloatMultiplyInstruction.src/M000086.html +15 -0
- data/doc/classes/FloatNegativeInstruction.html +218 -0
- data/doc/classes/FloatNegativeInstruction.src/M000103.html +15 -0
- data/doc/classes/FloatNegativeInstruction.src/M000104.html +15 -0
- data/doc/classes/FloatNegativeInstruction.src/M000105.html +15 -0
- data/doc/classes/FloatNegativeInstruction.src/M000106.html +15 -0
- data/doc/classes/FloatPowerInstruction.html +218 -0
- data/doc/classes/FloatPowerInstruction.src/M000111.html +15 -0
- data/doc/classes/FloatPowerInstruction.src/M000112.html +16 -0
- data/doc/classes/FloatPowerInstruction.src/M000113.html +20 -0
- data/doc/classes/FloatPowerInstruction.src/M000114.html +15 -0
- data/doc/classes/FloatRandomInstruction.html +218 -0
- data/doc/classes/FloatRandomInstruction.src/M000191.html +15 -0
- data/doc/classes/FloatRandomInstruction.src/M000192.html +14 -0
- data/doc/classes/FloatRandomInstruction.src/M000193.html +15 -0
- data/doc/classes/FloatRandomInstruction.src/M000194.html +15 -0
- data/doc/classes/FloatSineInstruction.html +218 -0
- data/doc/classes/FloatSineInstruction.src/M000119.html +15 -0
- data/doc/classes/FloatSineInstruction.src/M000120.html +15 -0
- data/doc/classes/FloatSineInstruction.src/M000121.html +15 -0
- data/doc/classes/FloatSineInstruction.src/M000122.html +15 -0
- data/doc/classes/FloatSqrtInstruction.html +218 -0
- data/doc/classes/FloatSqrtInstruction.src/M000115.html +15 -0
- data/doc/classes/FloatSqrtInstruction.src/M000116.html +15 -0
- data/doc/classes/FloatSqrtInstruction.src/M000117.html +19 -0
- data/doc/classes/FloatSqrtInstruction.src/M000118.html +15 -0
- data/doc/classes/FloatSubtractInstruction.html +218 -0
- data/doc/classes/FloatSubtractInstruction.src/M000087.html +15 -0
- data/doc/classes/FloatSubtractInstruction.src/M000088.html +16 -0
- data/doc/classes/FloatSubtractInstruction.src/M000089.html +15 -0
- data/doc/classes/FloatSubtractInstruction.src/M000090.html +15 -0
- data/doc/classes/FloatTangentInstruction.html +218 -0
- data/doc/classes/FloatTangentInstruction.src/M000127.html +15 -0
- data/doc/classes/FloatTangentInstruction.src/M000128.html +15 -0
- data/doc/classes/FloatTangentInstruction.src/M000129.html +15 -0
- data/doc/classes/FloatTangentInstruction.src/M000130.html +15 -0
- data/doc/classes/FloatType.html +196 -0
- data/doc/classes/FloatType.src/M000243.html +19 -0
- data/doc/classes/FloatType.src/M000244.html +15 -0
- data/doc/classes/FloatType.src/M000245.html +15 -0
- data/doc/classes/Helpers.html +161 -0
- data/doc/classes/Helpers.src/M000343.html +21 -0
- data/doc/classes/Helpers.src/M000344.html +24 -0
- data/doc/classes/Instruction/InstructionMethodError.html +110 -0
- data/doc/classes/Instruction/NaNResultError.html +110 -0
- data/doc/classes/Instruction/NotEnoughStackItems.html +110 -0
- data/doc/classes/Instruction.html +500 -0
- data/doc/classes/Instruction.src/M000131.html +17 -0
- data/doc/classes/Instruction.src/M000132.html +15 -0
- data/doc/classes/Instruction.src/M000133.html +15 -0
- data/doc/classes/Instruction.src/M000134.html +15 -0
- data/doc/classes/Instruction.src/M000135.html +15 -0
- data/doc/classes/Instruction.src/M000136.html +15 -0
- data/doc/classes/Instruction.src/M000137.html +15 -0
- data/doc/classes/Instruction.src/M000138.html +15 -0
- data/doc/classes/Instruction.src/M000139.html +22 -0
- data/doc/classes/Instruction.src/M000140.html +15 -0
- data/doc/classes/Instruction.src/M000141.html +25 -0
- data/doc/classes/Instruction.src/M000142.html +15 -0
- data/doc/classes/Instruction.src/M000143.html +15 -0
- data/doc/classes/Instruction.src/M000144.html +15 -0
- data/doc/classes/Instruction.src/M000145.html +15 -0
- data/doc/classes/Instruction.src/M000146.html +15 -0
- data/doc/classes/InstructionNode.html +161 -0
- data/doc/classes/InstructionNode.src/M000247.html +15 -0
- data/doc/classes/InstructionNode.src/M000248.html +16 -0
- data/doc/classes/IntAbsInstruction.html +218 -0
- data/doc/classes/IntAbsInstruction.src/M000175.html +15 -0
- data/doc/classes/IntAbsInstruction.src/M000176.html +15 -0
- data/doc/classes/IntAbsInstruction.src/M000177.html +15 -0
- data/doc/classes/IntAbsInstruction.src/M000178.html +15 -0
- data/doc/classes/IntAddInstruction.html +218 -0
- data/doc/classes/IntAddInstruction.src/M000147.html +15 -0
- data/doc/classes/IntAddInstruction.src/M000148.html +16 -0
- data/doc/classes/IntAddInstruction.src/M000149.html +15 -0
- data/doc/classes/IntAddInstruction.src/M000150.html +15 -0
- data/doc/classes/IntDepthInstruction.html +218 -0
- data/doc/classes/IntDepthInstruction.src/M000211.html +15 -0
- data/doc/classes/IntDepthInstruction.src/M000212.html +14 -0
- data/doc/classes/IntDepthInstruction.src/M000213.html +15 -0
- data/doc/classes/IntDepthInstruction.src/M000214.html +15 -0
- data/doc/classes/IntDivideInstruction.html +218 -0
- data/doc/classes/IntDivideInstruction.src/M000155.html +15 -0
- data/doc/classes/IntDivideInstruction.src/M000156.html +16 -0
- data/doc/classes/IntDivideInstruction.src/M000157.html +20 -0
- data/doc/classes/IntDivideInstruction.src/M000158.html +15 -0
- data/doc/classes/IntDuplicateInstruction.html +218 -0
- data/doc/classes/IntDuplicateInstruction.src/M000203.html +15 -0
- data/doc/classes/IntDuplicateInstruction.src/M000204.html +15 -0
- data/doc/classes/IntDuplicateInstruction.src/M000205.html +15 -0
- data/doc/classes/IntDuplicateInstruction.src/M000206.html +15 -0
- data/doc/classes/IntEqualQInstruction.html +218 -0
- data/doc/classes/IntEqualQInstruction.src/M000023.html +15 -0
- data/doc/classes/IntEqualQInstruction.src/M000024.html +16 -0
- data/doc/classes/IntEqualQInstruction.src/M000025.html +15 -0
- data/doc/classes/IntEqualQInstruction.src/M000026.html +15 -0
- data/doc/classes/IntFlushInstruction.html +218 -0
- data/doc/classes/IntFlushInstruction.src/M000215.html +15 -0
- data/doc/classes/IntFlushInstruction.src/M000216.html +14 -0
- data/doc/classes/IntFlushInstruction.src/M000217.html +14 -0
- data/doc/classes/IntFlushInstruction.src/M000218.html +15 -0
- data/doc/classes/IntFromBoolInstruction.html +218 -0
- data/doc/classes/IntFromBoolInstruction.src/M000051.html +15 -0
- data/doc/classes/IntFromBoolInstruction.src/M000052.html +15 -0
- data/doc/classes/IntFromBoolInstruction.src/M000053.html +15 -0
- data/doc/classes/IntFromBoolInstruction.src/M000054.html +15 -0
- data/doc/classes/IntFromFloatInstruction.html +218 -0
- data/doc/classes/IntFromFloatInstruction.src/M000059.html +15 -0
- data/doc/classes/IntFromFloatInstruction.src/M000060.html +15 -0
- data/doc/classes/IntFromFloatInstruction.src/M000061.html +15 -0
- data/doc/classes/IntFromFloatInstruction.src/M000062.html +15 -0
- data/doc/classes/IntGreaterThanQInstruction.html +218 -0
- data/doc/classes/IntGreaterThanQInstruction.src/M000031.html +15 -0
- data/doc/classes/IntGreaterThanQInstruction.src/M000032.html +16 -0
- data/doc/classes/IntGreaterThanQInstruction.src/M000033.html +15 -0
- data/doc/classes/IntGreaterThanQInstruction.src/M000034.html +15 -0
- data/doc/classes/IntIfInstruction.html +218 -0
- data/doc/classes/IntIfInstruction.src/M000043.html +16 -0
- data/doc/classes/IntIfInstruction.src/M000044.html +15 -0
- data/doc/classes/IntIfInstruction.src/M000045.html +14 -0
- data/doc/classes/IntIfInstruction.src/M000046.html +17 -0
- data/doc/classes/IntLessThanQInstruction.html +218 -0
- data/doc/classes/IntLessThanQInstruction.src/M000027.html +15 -0
- data/doc/classes/IntLessThanQInstruction.src/M000028.html +16 -0
- data/doc/classes/IntLessThanQInstruction.src/M000029.html +15 -0
- data/doc/classes/IntLessThanQInstruction.src/M000030.html +15 -0
- data/doc/classes/IntMaxInstruction.html +218 -0
- data/doc/classes/IntMaxInstruction.src/M000167.html +15 -0
- data/doc/classes/IntMaxInstruction.src/M000168.html +16 -0
- data/doc/classes/IntMaxInstruction.src/M000169.html +16 -0
- data/doc/classes/IntMaxInstruction.src/M000170.html +15 -0
- data/doc/classes/IntMinInstruction.html +218 -0
- data/doc/classes/IntMinInstruction.src/M000171.html +15 -0
- data/doc/classes/IntMinInstruction.src/M000172.html +16 -0
- data/doc/classes/IntMinInstruction.src/M000173.html +16 -0
- data/doc/classes/IntMinInstruction.src/M000174.html +15 -0
- data/doc/classes/IntModuloInstruction.html +218 -0
- data/doc/classes/IntModuloInstruction.src/M000163.html +15 -0
- data/doc/classes/IntModuloInstruction.src/M000164.html +16 -0
- data/doc/classes/IntModuloInstruction.src/M000165.html +20 -0
- data/doc/classes/IntModuloInstruction.src/M000166.html +15 -0
- data/doc/classes/IntMultiplyInstruction.html +218 -0
- data/doc/classes/IntMultiplyInstruction.src/M000151.html +15 -0
- data/doc/classes/IntMultiplyInstruction.src/M000152.html +16 -0
- data/doc/classes/IntMultiplyInstruction.src/M000153.html +15 -0
- data/doc/classes/IntMultiplyInstruction.src/M000154.html +15 -0
- data/doc/classes/IntNegativeInstruction.html +218 -0
- data/doc/classes/IntNegativeInstruction.src/M000179.html +15 -0
- data/doc/classes/IntNegativeInstruction.src/M000180.html +15 -0
- data/doc/classes/IntNegativeInstruction.src/M000181.html +15 -0
- data/doc/classes/IntNegativeInstruction.src/M000182.html +15 -0
- data/doc/classes/IntPopInstruction.html +218 -0
- data/doc/classes/IntPopInstruction.src/M000195.html +15 -0
- data/doc/classes/IntPopInstruction.src/M000196.html +15 -0
- data/doc/classes/IntPopInstruction.src/M000197.html +14 -0
- data/doc/classes/IntPopInstruction.src/M000198.html +14 -0
- data/doc/classes/IntRandomInstruction.html +218 -0
- data/doc/classes/IntRandomInstruction.src/M000183.html +15 -0
- data/doc/classes/IntRandomInstruction.src/M000184.html +14 -0
- data/doc/classes/IntRandomInstruction.src/M000185.html +15 -0
- data/doc/classes/IntRandomInstruction.src/M000186.html +15 -0
- data/doc/classes/IntRotateInstruction.html +218 -0
- data/doc/classes/IntRotateInstruction.src/M000207.html +15 -0
- data/doc/classes/IntRotateInstruction.src/M000208.html +17 -0
- data/doc/classes/IntRotateInstruction.src/M000209.html +14 -0
- data/doc/classes/IntRotateInstruction.src/M000210.html +17 -0
- data/doc/classes/IntSubtractInstruction.html +218 -0
- data/doc/classes/IntSubtractInstruction.src/M000159.html +15 -0
- data/doc/classes/IntSubtractInstruction.src/M000160.html +16 -0
- data/doc/classes/IntSubtractInstruction.src/M000161.html +16 -0
- data/doc/classes/IntSubtractInstruction.src/M000162.html +15 -0
- data/doc/classes/IntSwapInstruction.html +218 -0
- data/doc/classes/IntSwapInstruction.src/M000199.html +15 -0
- data/doc/classes/IntSwapInstruction.src/M000200.html +16 -0
- data/doc/classes/IntSwapInstruction.src/M000201.html +14 -0
- data/doc/classes/IntSwapInstruction.src/M000202.html +16 -0
- data/doc/classes/IntType.html +240 -0
- data/doc/classes/IntType.src/M000235.html +15 -0
- data/doc/classes/IntType.src/M000236.html +15 -0
- data/doc/classes/IntType.src/M000237.html +18 -0
- data/doc/classes/IntType.src/M000238.html +15 -0
- data/doc/classes/IntType.src/M000239.html +15 -0
- data/doc/classes/LiteralNode.html +183 -0
- data/doc/classes/LiteralNode.src/M000251.html +15 -0
- data/doc/classes/LiteralNode.src/M000252.html +16 -0
- data/doc/classes/LiteralNode.src/M000253.html +16 -0
- data/doc/classes/Nudge/Channel.html +437 -0
- data/doc/classes/Nudge/Channel.src/M000286.html +15 -0
- data/doc/classes/Nudge/Channel.src/M000287.html +19 -0
- data/doc/classes/Nudge/Channel.src/M000288.html +15 -0
- data/doc/classes/Nudge/Channel.src/M000289.html +15 -0
- data/doc/classes/Nudge/Channel.src/M000290.html +15 -0
- data/doc/classes/Nudge/Channel.src/M000291.html +19 -0
- data/doc/classes/Nudge/Channel.src/M000292.html +19 -0
- data/doc/classes/Nudge/Channel.src/M000293.html +17 -0
- data/doc/classes/Nudge/Channel.src/M000294.html +15 -0
- data/doc/classes/Nudge/Channel.src/M000295.html +20 -0
- data/doc/classes/Nudge/Channel.src/M000296.html +15 -0
- data/doc/classes/Nudge/Channel.src/M000297.html +17 -0
- data/doc/classes/Nudge/Channel.src/M000298.html +15 -0
- data/doc/classes/Nudge/CodeBlock.html +331 -0
- data/doc/classes/Nudge/CodeBlock.src/M000263.html +15 -0
- data/doc/classes/Nudge/CodeBlock.src/M000264.html +15 -0
- data/doc/classes/Nudge/CodeBlock.src/M000265.html +15 -0
- data/doc/classes/Nudge/CodeBlock.src/M000266.html +15 -0
- data/doc/classes/Nudge/CodeBlock.src/M000267.html +15 -0
- data/doc/classes/Nudge/CodeBlock.src/M000268.html +17 -0
- data/doc/classes/Nudge/CodeBlock.src/M000269.html +20 -0
- data/doc/classes/Nudge/CodeBlock.src/M000270.html +15 -0
- data/doc/classes/Nudge/CodeBlock.src/M000271.html +19 -0
- data/doc/classes/Nudge/DeadLocation.html +152 -0
- data/doc/classes/Nudge/DeadLocation.src/M000334.html +17 -0
- data/doc/classes/Nudge/Erc.html +335 -0
- data/doc/classes/Nudge/Erc.src/M000278.html +16 -0
- data/doc/classes/Nudge/Erc.src/M000279.html +15 -0
- data/doc/classes/Nudge/Erc.src/M000280.html +15 -0
- data/doc/classes/Nudge/Erc.src/M000281.html +15 -0
- data/doc/classes/Nudge/Erc.src/M000282.html +18 -0
- data/doc/classes/Nudge/Erc.src/M000283.html +15 -0
- data/doc/classes/Nudge/Erc.src/M000284.html +17 -0
- data/doc/classes/Nudge/Erc.src/M000285.html +15 -0
- data/doc/classes/Nudge/Individual.html +313 -0
- data/doc/classes/Nudge/Individual.src/M000314.html +21 -0
- data/doc/classes/Nudge/Individual.src/M000315.html +15 -0
- data/doc/classes/Nudge/Individual.src/M000316.html +15 -0
- data/doc/classes/Nudge/Individual.src/M000317.html +17 -0
- data/doc/classes/Nudge/Individual.src/M000318.html +25 -0
- data/doc/classes/Nudge/InstructionPoint/InstructionNotFoundError.html +110 -0
- data/doc/classes/Nudge/InstructionPoint.html +350 -0
- data/doc/classes/Nudge/InstructionPoint.src/M000299.html +15 -0
- data/doc/classes/Nudge/InstructionPoint.src/M000300.html +15 -0
- data/doc/classes/Nudge/InstructionPoint.src/M000301.html +17 -0
- data/doc/classes/Nudge/InstructionPoint.src/M000302.html +15 -0
- data/doc/classes/Nudge/InstructionPoint.src/M000303.html +17 -0
- data/doc/classes/Nudge/InstructionPoint.src/M000304.html +17 -0
- data/doc/classes/Nudge/InstructionPoint.src/M000305.html +17 -0
- data/doc/classes/Nudge/InstructionPoint.src/M000306.html +15 -0
- data/doc/classes/Nudge/Interpreter.html +369 -0
- data/doc/classes/Nudge/Interpreter.src/M000257.html +20 -0
- data/doc/classes/Nudge/Interpreter.src/M000258.html +19 -0
- data/doc/classes/Nudge/Interpreter.src/M000259.html +15 -0
- data/doc/classes/Nudge/Interpreter.src/M000260.html +19 -0
- data/doc/classes/Nudge/Interpreter.src/M000261.html +17 -0
- data/doc/classes/Nudge/LiteralPoint.html +291 -0
- data/doc/classes/Nudge/LiteralPoint.src/M000272.html +16 -0
- data/doc/classes/Nudge/LiteralPoint.src/M000273.html +15 -0
- data/doc/classes/Nudge/LiteralPoint.src/M000274.html +15 -0
- data/doc/classes/Nudge/LiteralPoint.src/M000275.html +18 -0
- data/doc/classes/Nudge/LiteralPoint.src/M000276.html +17 -0
- data/doc/classes/Nudge/LiteralPoint.src/M000277.html +15 -0
- data/doc/classes/Nudge/Location.html +525 -0
- data/doc/classes/Nudge/Location.src/M000319.html +19 -0
- data/doc/classes/Nudge/Location.src/M000320.html +15 -0
- data/doc/classes/Nudge/Location.src/M000321.html +26 -0
- data/doc/classes/Nudge/Location.src/M000322.html +15 -0
- data/doc/classes/Nudge/Location.src/M000323.html +20 -0
- data/doc/classes/Nudge/Location.src/M000324.html +16 -0
- data/doc/classes/Nudge/Location.src/M000325.html +25 -0
- data/doc/classes/Nudge/Location.src/M000326.html +15 -0
- data/doc/classes/Nudge/Location.src/M000327.html +21 -0
- data/doc/classes/Nudge/Location.src/M000328.html +16 -0
- data/doc/classes/Nudge/Location.src/M000329.html +15 -0
- data/doc/classes/Nudge/Location.src/M000330.html +16 -0
- data/doc/classes/Nudge/Location.src/M000331.html +20 -0
- data/doc/classes/Nudge/Location.src/M000332.html +17 -0
- data/doc/classes/Nudge/Location.src/M000333.html +17 -0
- data/doc/classes/Nudge/NondominatedSubset.html +196 -0
- data/doc/classes/Nudge/NondominatedSubset.src/M000005.html +19 -0
- data/doc/classes/Nudge/NondominatedSubset.src/M000006.html +19 -0
- data/doc/classes/Nudge/NondominatedSubset.src/M000007.html +25 -0
- data/doc/classes/Nudge/NondominatedSubset.src/M000339.html +19 -0
- data/doc/classes/Nudge/NondominatedSubset.src/M000340.html +19 -0
- data/doc/classes/Nudge/NondominatedSubset.src/M000341.html +25 -0
- data/doc/classes/Nudge/PopulationResample.html +175 -0
- data/doc/classes/Nudge/PopulationResample.src/M000003.html +22 -0
- data/doc/classes/Nudge/PopulationResample.src/M000337.html +22 -0
- data/doc/classes/Nudge/ProgramPoint.html +148 -0
- data/doc/classes/Nudge/ProgramPoint.src/M000262.html +15 -0
- data/doc/classes/Nudge/RandomGuess.html +176 -0
- data/doc/classes/Nudge/RandomGuess.src/M000002.html +21 -0
- data/doc/classes/Nudge/RandomGuess.src/M000336.html +21 -0
- data/doc/classes/Nudge/ResampleValues.html +169 -0
- data/doc/classes/Nudge/ResampleValues.src/M000004.html +36 -0
- data/doc/classes/Nudge/ResampleValues.src/M000338.html +36 -0
- data/doc/classes/Nudge/SearchOperator.html +175 -0
- data/doc/classes/Nudge/SearchOperator.src/M000001.html +15 -0
- data/doc/classes/Nudge/SearchOperator.src/M000335.html +15 -0
- data/doc/classes/Nudge/Stack.html +350 -0
- data/doc/classes/Nudge/Stack.src/M000307.html +15 -0
- data/doc/classes/Nudge/Stack.src/M000308.html +15 -0
- data/doc/classes/Nudge/Stack.src/M000309.html +18 -0
- data/doc/classes/Nudge/Stack.src/M000310.html +15 -0
- data/doc/classes/Nudge/Stack.src/M000311.html +15 -0
- data/doc/classes/Nudge/Stack.src/M000312.html +15 -0
- data/doc/classes/Nudge/Stack.src/M000313.html +15 -0
- data/doc/classes/Nudge/UniformBackboneCrossover.html +152 -0
- data/doc/classes/Nudge/UniformBackboneCrossover.src/M000008.html +35 -0
- data/doc/classes/Nudge/UniformBackboneCrossover.src/M000342.html +35 -0
- data/doc/classes/Nudge.html +174 -0
- data/doc/classes/NudgeType.html +363 -0
- data/doc/classes/NudgeType.src/M000225.html +17 -0
- data/doc/classes/NudgeType.src/M000226.html +15 -0
- data/doc/classes/NudgeType.src/M000227.html +15 -0
- data/doc/classes/NudgeType.src/M000228.html +15 -0
- data/doc/classes/NudgeType.src/M000229.html +15 -0
- data/doc/classes/NudgeType.src/M000230.html +15 -0
- data/doc/classes/NudgeType.src/M000231.html +15 -0
- data/doc/classes/NudgeType.src/M000232.html +15 -0
- data/doc/classes/NudgeType.src/M000233.html +15 -0
- data/doc/classes/NudgeType.src/M000234.html +15 -0
- data/doc/created.rid +1 -0
- data/doc/files/lib/instructions/bool_basics_rb.html +90 -0
- data/doc/files/lib/instructions/comparisons_rb.html +90 -0
- data/doc/files/lib/instructions/conditionals_rb.html +90 -0
- data/doc/files/lib/instructions/conversions_rb.html +90 -0
- data/doc/files/lib/instructions/exec_rb.html +90 -0
- data/doc/files/lib/instructions/float_arithmetic_rb.html +90 -0
- data/doc/files/lib/instructions/float_transcendental_rb.html +90 -0
- data/doc/files/lib/instructions/infrastructure_rb.html +100 -0
- data/doc/files/lib/instructions/int_arithmetic_rb.html +90 -0
- data/doc/files/lib/instructions/random_value_rb.html +90 -0
- data/doc/files/lib/instructions/stack_manipulation_rb.html +90 -0
- data/doc/files/lib/interpreter/grammars/nudge_language_helpers_rb.html +97 -0
- data/doc/files/lib/interpreter/grammars/nudge_language_treetop.html +180 -0
- data/doc/files/lib/interpreter/interpreter_rb.html +90 -0
- data/doc/files/lib/interpreter/programPoints_rb.html +90 -0
- data/doc/files/lib/interpreter/stack_rb.html +90 -0
- data/doc/files/lib/interpreter/types/codeType_rb.html +157 -0
- data/doc/files/lib/interpreter/types/codeType_rb.src/M000001.html +15 -0
- data/doc/files/lib/interpreter/types/codeType_rb.src/M000002.html +15 -0
- data/doc/files/lib/interpreter/types/pushTypes_rb.html +107 -0
- data/doc/files/lib/nudge_rb.html +152 -0
- data/doc/files/lib/search/evaluators/structural_complexity_rb.html +90 -0
- data/doc/files/lib/search/helpers_rb.html +90 -0
- data/doc/files/lib/search/individual/individual_rb.html +90 -0
- data/doc/files/lib/search/locations/location_rb.html +100 -0
- data/doc/files/lib/search/operators/basic_operators_rb.html +90 -0
- data/doc/fr_class_index.html +191 -0
- data/doc/fr_file_index.html +71 -0
- data/doc/fr_method_index.html +711 -0
- data/doc/index.html +21 -0
- data/doc/rdoc-style.css +299 -0
- data/features/parser_recognizes_nudge_language.feature +9 -0
- data/lib/instructions/bool_basics.rb +85 -0
- data/lib/instructions/code_basics.rb +14 -0
- data/lib/instructions/comparisons.rb +152 -0
- data/lib/instructions/conditionals.rb +44 -0
- data/lib/instructions/conversions.rb +94 -0
- data/lib/instructions/exec.rb +154 -0
- data/lib/instructions/float_arithmetic.rb +201 -0
- data/lib/instructions/float_transcendental.rb +47 -0
- data/lib/instructions/infrastructure.rb +84 -0
- data/lib/instructions/int_arithmetic.rb +160 -0
- data/lib/instructions/name_basics.rb +44 -0
- data/lib/instructions/name_bindings.rb +65 -0
- data/lib/instructions/random_value.rb +43 -0
- data/lib/instructions/stack_manipulation.rb +739 -0
- data/lib/interpreter/grammars/nudge_language.treetop +83 -0
- data/lib/interpreter/grammars/nudge_language_helpers.rb +64 -0
- data/lib/interpreter/interpreter.rb +176 -0
- data/lib/interpreter/programPoints.rb +236 -0
- data/lib/interpreter/stack.rb +39 -0
- data/lib/interpreter/types/codeType.rb +108 -0
- data/lib/interpreter/types/pushTypes.rb +102 -0
- data/lib/nudge.rb +38 -0
- data/lib/search/experiments/experiment.rb +53 -0
- data/lib/search/helpers.rb +22 -0
- data/lib/search/individual/batch.rb +25 -0
- data/lib/search/individual/individual.rb +147 -0
- data/lib/search/operators/basic_operators.rb +230 -0
- data/lib/search/operators/evaluators.rb +107 -0
- data/lib/search/operators/samplers_and_selectors.rb +123 -0
- data/lib/search/stations/station.rb +147 -0
- data/push_language_coverage.md +177 -0
- data/readme.md +19 -0
- data/spec/data/couchdb_spec.rb +2 -0
- data/spec/fixtures/just_block.example +1 -0
- data/spec/fixtures/just_block_with_newline.example +1 -0
- data/spec/fixtures/long_arithmetic.example +7 -0
- data/spec/fixtures/one_line_instr.example +1 -0
- data/spec/fixtures/untidy1.example +20 -0
- data/spec/fixtures/untidy1fixed.example +12 -0
- data/spec/instructions/bool_basics_spec.rb +97 -0
- data/spec/instructions/bool_stack_spec.rb +391 -0
- data/spec/instructions/code_basics_spec.rb +43 -0
- data/spec/instructions/code_stack_spec.rb +382 -0
- data/spec/instructions/comparisons_spec.rb +486 -0
- data/spec/instructions/conditionals_spec.rb +162 -0
- data/spec/instructions/conversions_spec.rb +92 -0
- data/spec/instructions/exec_spec.rb +883 -0
- data/spec/instructions/float_calculations_spec.rb +148 -0
- data/spec/instructions/float_stack_spec.rb +382 -0
- data/spec/instructions/float_transcendental_spec.rb +89 -0
- data/spec/instructions/instruction_class_spec.rb +9 -0
- data/spec/instructions/int_calculations_spec.rb +125 -0
- data/spec/instructions/int_stack_spec.rb +398 -0
- data/spec/instructions/name_basics_spec.rb +158 -0
- data/spec/instructions/name_bindings_spec.rb +257 -0
- data/spec/instructions/name_stack_spec.rb +382 -0
- data/spec/instructions/random_values_spec.rb +68 -0
- data/spec/integration/search_integration.rb +67 -0
- data/spec/interpreter/channel_spec.rb +92 -0
- data/spec/interpreter/codeblock_spec.rb +135 -0
- data/spec/interpreter/codetype_spec.rb +257 -0
- data/spec/interpreter/erc_spec.rb +130 -0
- data/spec/interpreter/instruction_spec.rb +97 -0
- data/spec/interpreter/interpreter_spec.rb +266 -0
- data/spec/interpreter/literal_spec.rb +94 -0
- data/spec/interpreter/parser_spec.rb +324 -0
- data/spec/interpreter/stack_spec.rb +81 -0
- data/spec/interpreter/types_spec.rb +102 -0
- data/spec/search/batch_spec.rb +30 -0
- data/spec/search/experiments/experiment_spec.rb +101 -0
- data/spec/search/helpers_spec.rb +59 -0
- data/spec/search/individual_spec.rb +356 -0
- data/spec/search/operators/any_one_sampler_spec.rb +40 -0
- data/spec/search/operators/dominated_quantile_spec.rb +111 -0
- data/spec/search/operators/duplicate_genomes_spec.rb +35 -0
- data/spec/search/operators/evaluators/program_point_evaluator_spec.rb +43 -0
- data/spec/search/operators/evaluators/test_case_evaluator_spec.rb +133 -0
- data/spec/search/operators/infrastructure_spec.rb +47 -0
- data/spec/search/operators/most_dominated_subset_spec.rb +47 -0
- data/spec/search/operators/nondominated_subset_spec.rb +97 -0
- data/spec/search/operators/pointCrossover_spec.rb +55 -0
- data/spec/search/operators/pointDeletion_spec.rb +57 -0
- data/spec/search/operators/pointMutation_spec.rb +71 -0
- data/spec/search/operators/random_guess_spec.rb +51 -0
- data/spec/search/operators/resample_and_clone_spec.rb +50 -0
- data/spec/search/operators/resample_values_spec.rb +126 -0
- data/spec/search/operators/sizePreservingMutation_spec.rb +2 -0
- data/spec/search/operators/uniformBackboneCrossover_spec.rb +63 -0
- data/spec/search/stations/station_spec.rb +496 -0
- data/spec/spec_helper.rb +11 -0
- metadata +738 -0
@@ -0,0 +1,340 @@
|
|
1
|
+
Nudge::Config.setup do |experiment|
|
2
|
+
|
3
|
+
# set up instructions
|
4
|
+
experiment.instructions =
|
5
|
+
[IntModuloInstruction, IntMultiplyInstruction, IntAddInstruction, IntSubtractInstruction,
|
6
|
+
IntDivideInstruction, IntLessThanQInstruction, IntEqualQInstruction, IntGreaterThanQInstruction,
|
7
|
+
IntDuplicateInstruction, IntFlushInstruction, IntFromBoolInstruction, IntMaxInstruction,
|
8
|
+
IntMinInstruction, IntPopInstruction, IntRotateInstruction, IntShoveInstruction,
|
9
|
+
IntDepthInstruction, IntSwapInstruction, IntYankInstruction, IntYankdupInstruction, IntAbsInstruction,
|
10
|
+
IntIfInstruction, IntNegativeInstruction, BoolEqualQInstruction, BoolAndInstruction,
|
11
|
+
BoolDuplicateInstruction, BoolFlushInstruction, BoolFromIntInstruction, BoolNotInstruction,
|
12
|
+
BoolOrInstruction, BoolPopInstruction, BoolRotateInstruction,
|
13
|
+
BoolShoveInstruction, BoolDepthInstruction, BoolSwapInstruction, BoolYankInstruction,
|
14
|
+
BoolYankdupInstruction, BoolXorInstruction]
|
15
|
+
|
16
|
+
|
17
|
+
# set up variable names
|
18
|
+
experiment.variable_names = ["x1", "x2"]
|
19
|
+
|
20
|
+
# set up types
|
21
|
+
experiment.types = [IntType, BoolType]
|
22
|
+
|
23
|
+
# set up stations
|
24
|
+
experiment.build_station("generator1",
|
25
|
+
:capacity => 1,
|
26
|
+
:cull_trigger => Proc.new {false},
|
27
|
+
:generate_rule => Proc.new {|placeholder| RandomGuessOperator.new(
|
28
|
+
:instructions => experiment.instructions,
|
29
|
+
:references => experiment.variable_names,
|
30
|
+
:types => experiment.types).generate(1,:points => rand(20)+10)
|
31
|
+
},
|
32
|
+
:promotion_rule => Proc.new {|anybody| true}
|
33
|
+
)
|
34
|
+
|
35
|
+
experiment.build_station("generator2",
|
36
|
+
:capacity => 1,
|
37
|
+
:cull_trigger => Proc.new {false},
|
38
|
+
:generate_rule => Proc.new {|placeholder| RandomGuessOperator.new(
|
39
|
+
:instructions => experiment.instructions,
|
40
|
+
:references => experiment.variable_names,
|
41
|
+
:types => experiment.types).generate(1,:points => rand(30)+20)
|
42
|
+
},
|
43
|
+
:promotion_rule => Proc.new {|anybody| true}
|
44
|
+
)
|
45
|
+
|
46
|
+
experiment.build_station("level1",
|
47
|
+
:capacity => 100,
|
48
|
+
:generate_rule => Proc.new do |pop|
|
49
|
+
if pop.length > 80
|
50
|
+
bw = pop.minmax {|a,b| (a.scores["errors"] || 10000) <=> (b.scores["errors"] || 10000) }
|
51
|
+
bw.each {|dude| puts "#{dude.progress}: #{dude.scores} [#{dude.genome}]\n\n"}
|
52
|
+
|
53
|
+
mySampler = ResampleAndCloneOperator.new
|
54
|
+
myCrossover = PointCrossoverOperator.new
|
55
|
+
myMutator = PointMutationOperator.new(
|
56
|
+
instructions:[IntModuloInstruction, IntMultiplyInstruction, IntAddInstruction,IntSubtractInstruction,
|
57
|
+
IntDivideInstruction, IntLessThanQInstruction, IntEqualQInstruction, IntGreaterThanQInstruction,
|
58
|
+
IntDuplicateInstruction, IntFlushInstruction, IntFromBoolInstruction, IntMaxInstruction,
|
59
|
+
IntMinInstruction, IntPopInstruction, IntRotateInstruction,IntShoveInstruction,
|
60
|
+
IntDepthInstruction, IntSwapInstruction, IntYankInstruction, IntYankdupInstruction,IntAbsInstruction,
|
61
|
+
IntIfInstruction, IntNegativeInstruction, BoolEqualQInstruction, BoolAndInstruction,
|
62
|
+
BoolDuplicateInstruction, BoolFlushInstruction, BoolFromIntInstruction, BoolNotInstruction,
|
63
|
+
BoolOrInstruction, BoolPopInstruction, BoolRotateInstruction,
|
64
|
+
BoolShoveInstruction, BoolDepthInstruction, BoolSwapInstruction, BoolYankInstruction,
|
65
|
+
BoolYankdupInstruction, BoolXorInstruction],
|
66
|
+
types:[IntType, BoolType],
|
67
|
+
references:["x1","x2"])
|
68
|
+
mySelector = NondominatedSubsetSelector.new
|
69
|
+
myEvaluator = TestCaseEvaluator.new(
|
70
|
+
:name => "errors",
|
71
|
+
:instructions =>
|
72
|
+
[IntModuloInstruction, IntMultiplyInstruction, IntAddInstruction,IntSubtractInstruction,
|
73
|
+
IntDivideInstruction, IntLessThanQInstruction, IntEqualQInstruction, IntGreaterThanQInstruction,
|
74
|
+
IntDuplicateInstruction, IntFlushInstruction, IntFromBoolInstruction, IntMaxInstruction,
|
75
|
+
IntMinInstruction, IntPopInstruction, IntRotateInstruction,IntShoveInstruction,
|
76
|
+
IntDepthInstruction, IntSwapInstruction, IntYankInstruction,
|
77
|
+
IntYankdupInstruction,IntAbsInstruction, IntIfInstruction, IntNegativeInstruction,
|
78
|
+
BoolEqualQInstruction, BoolAndInstruction,
|
79
|
+
BoolDuplicateInstruction, BoolFlushInstruction, BoolFromIntInstruction, BoolNotInstruction,
|
80
|
+
BoolOrInstruction, BoolPopInstruction, BoolRotateInstruction,
|
81
|
+
BoolShoveInstruction, BoolDepthInstruction, BoolSwapInstruction, BoolYankInstruction,
|
82
|
+
BoolYankdupInstruction, BoolXorInstruction],
|
83
|
+
:references => ["x1", "x2"],
|
84
|
+
:types => [IntType, BoolType]
|
85
|
+
)
|
86
|
+
myPointsEvaluator = ProgramPointEvaluator.new(:name => "points")
|
87
|
+
myCases = (-10..10).collect do |i|
|
88
|
+
TestCase.new(:bindings => {"x1" => LiteralPoint.new("int",i)},
|
89
|
+
:expectations => {"y" => 2*i*i*i - 8*i*i + 6 * i + 91},
|
90
|
+
:gauges => {"y" => Proc.new {|interp| interp.stacks[:int].peek}}
|
91
|
+
)
|
92
|
+
end
|
93
|
+
|
94
|
+
newGuys = Batch.new
|
95
|
+
10.times do
|
96
|
+
puts "."
|
97
|
+
tourney = mySampler.generate(pop,10) # pick 10 dudes at random from the population
|
98
|
+
tourney = myEvaluator.evaluate(tourney, myCases, deterministic:true) # evaluate them
|
99
|
+
tourney = myPointsEvaluator.evaluate(tourney)
|
100
|
+
|
101
|
+
babies = myCrossover.generate(tourney, 1) # create 1 babies from those
|
102
|
+
babies = myEvaluator.evaluate(babies, myCases, deterministic:true) # evaluate them
|
103
|
+
babies = myPointsEvaluator.evaluate(babies)
|
104
|
+
|
105
|
+
mutantBabies = myMutator.generate(babies, 2) # make 1 mutants of the babies
|
106
|
+
mutantBabies = myEvaluator.evaluate(babies, myCases, deterministic:true) # evaluate
|
107
|
+
mutantBabies = myPointsEvaluator.evaluate(mutantBabies)
|
108
|
+
|
109
|
+
bestInShow = mySelector.generate(tourney + babies + mutantBabies)
|
110
|
+
newGuys += bestInShow # retain only the best
|
111
|
+
end
|
112
|
+
newGuys
|
113
|
+
else
|
114
|
+
Batch.new
|
115
|
+
end
|
116
|
+
end,
|
117
|
+
:promotion_rule => Proc.new {|dude| dude.progress > 10}
|
118
|
+
)
|
119
|
+
|
120
|
+
experiment.build_station("level2",
|
121
|
+
:capacity => 100,
|
122
|
+
:generate_rule => Proc.new do |pop|
|
123
|
+
|
124
|
+
if pop.length > 70
|
125
|
+
bw = pop.minmax {|a,b| (a.scores["errors"] || 10000) <=> (b.scores["errors"] || 10000) }
|
126
|
+
bw.each {|dude| puts "#{dude.progress}: #{dude.scores} [#{dude.genome}]\n\n"}
|
127
|
+
|
128
|
+
mySampler = ResampleAndCloneOperator.new
|
129
|
+
myCrossover = PointCrossoverOperator.new
|
130
|
+
myMutator = PointMutationOperator.new(
|
131
|
+
instructions:[IntAddInstruction, IntSubtractInstruction,
|
132
|
+
IntMultiplyInstruction, IntDivideInstruction],
|
133
|
+
types:[IntType, BoolType],
|
134
|
+
references:["x1","x2"])
|
135
|
+
|
136
|
+
mySelector = NondominatedSubsetSelector.new
|
137
|
+
myEvaluator = TestCaseEvaluator.new(
|
138
|
+
:name => "errors",
|
139
|
+
:instructions =>
|
140
|
+
[IntModuloInstruction, IntMultiplyInstruction, IntAddInstruction,IntSubtractInstruction,
|
141
|
+
IntDivideInstruction, IntLessThanQInstruction, IntEqualQInstruction, IntGreaterThanQInstruction,
|
142
|
+
IntDuplicateInstruction, IntFlushInstruction, IntFromBoolInstruction, IntMaxInstruction,
|
143
|
+
IntMinInstruction, IntPopInstruction, IntRotateInstruction,IntShoveInstruction,
|
144
|
+
IntDepthInstruction, IntSwapInstruction, IntYankInstruction,
|
145
|
+
IntYankdupInstruction,IntAbsInstruction, IntIfInstruction, IntNegativeInstruction,
|
146
|
+
BoolEqualQInstruction, BoolAndInstruction,
|
147
|
+
BoolDuplicateInstruction, BoolFlushInstruction, BoolFromIntInstruction, BoolNotInstruction,
|
148
|
+
BoolOrInstruction, BoolPopInstruction, BoolRotateInstruction,
|
149
|
+
BoolShoveInstruction, BoolDepthInstruction, BoolSwapInstruction, BoolYankInstruction,
|
150
|
+
BoolYankdupInstruction, BoolXorInstruction],
|
151
|
+
:references => ["x1", "x2"],
|
152
|
+
:types => [IntType, BoolType]
|
153
|
+
)
|
154
|
+
myPointsEvaluator = ProgramPointEvaluator.new(:name => "points")
|
155
|
+
|
156
|
+
myCases = (-10..10).collect do |i|
|
157
|
+
TestCase.new(
|
158
|
+
:bindings => {"x1" => LiteralPoint.new("int",i)},
|
159
|
+
:expectations => {"y" => 2*i*i*i - 8*i*i + 6 * i + 91},
|
160
|
+
:gauges => {"y" => Proc.new {|interp| interp.stacks[:int].peek}}
|
161
|
+
)
|
162
|
+
end
|
163
|
+
|
164
|
+
newGuys = Batch.new
|
165
|
+
10.times do
|
166
|
+
puts "."
|
167
|
+
tourney = mySampler.generate(pop,8) # pick 6 dudes at random from the population
|
168
|
+
tourney = myEvaluator.evaluate(tourney, myCases, deterministic:true) # evaluate them
|
169
|
+
tourney = myPointsEvaluator.evaluate(tourney)
|
170
|
+
|
171
|
+
babies = myCrossover.generate(tourney, 2) # create 2 babies from those
|
172
|
+
babies = myEvaluator.evaluate(babies, myCases, deterministic:true) # evaluate them
|
173
|
+
babies = myPointsEvaluator.evaluate(babies)
|
174
|
+
|
175
|
+
mutantBabies = myMutator.generate(babies, 2) # make 2 mutants of the babies
|
176
|
+
mutantBabies = myEvaluator.evaluate(babies, myCases, deterministic:true) # evaluate
|
177
|
+
mutantBabies = myPointsEvaluator.evaluate(mutantBabies)
|
178
|
+
|
179
|
+
bestInShow = mySelector.generate(tourney + babies + mutantBabies)
|
180
|
+
newGuys += bestInShow # retain only the best
|
181
|
+
end
|
182
|
+
newGuys
|
183
|
+
else
|
184
|
+
Batch.new
|
185
|
+
end
|
186
|
+
end,
|
187
|
+
:promotion_rule => Proc.new {|dude| dude.progress > 20}
|
188
|
+
)
|
189
|
+
|
190
|
+
|
191
|
+
experiment.build_station("level3",
|
192
|
+
:capacity => 100,
|
193
|
+
:generate_rule => Proc.new do |pop|
|
194
|
+
|
195
|
+
if pop.length > 70
|
196
|
+
bw = pop.minmax {|a,b| (a.scores["errors"] || 10000) <=> (b.scores["errors"] || 10000) }
|
197
|
+
bw.each {|dude| puts "#{dude.progress}: #{dude.scores} [#{dude.genome}]\n\n"}
|
198
|
+
|
199
|
+
mySampler = ResampleAndCloneOperator.new
|
200
|
+
myCrossover = PointCrossoverOperator.new
|
201
|
+
myMutator = PointMutationOperator.new(
|
202
|
+
instructions:[IntAddInstruction, IntSubtractInstruction,
|
203
|
+
IntMultiplyInstruction, IntDivideInstruction],
|
204
|
+
types:[IntType, BoolType],
|
205
|
+
references:["x1","x2"])
|
206
|
+
|
207
|
+
mySelector = NondominatedSubsetSelector.new
|
208
|
+
myEvaluator = TestCaseEvaluator.new(
|
209
|
+
:name => "errors",
|
210
|
+
:instructions =>
|
211
|
+
[IntModuloInstruction, IntMultiplyInstruction, IntAddInstruction,IntSubtractInstruction,
|
212
|
+
IntDivideInstruction, IntLessThanQInstruction, IntEqualQInstruction, IntGreaterThanQInstruction,
|
213
|
+
IntDuplicateInstruction, IntFlushInstruction, IntFromBoolInstruction, IntMaxInstruction,
|
214
|
+
IntMinInstruction, IntPopInstruction, IntRotateInstruction,IntShoveInstruction,
|
215
|
+
IntDepthInstruction, IntSwapInstruction, IntYankInstruction,
|
216
|
+
IntYankdupInstruction,IntAbsInstruction, IntIfInstruction, IntNegativeInstruction,
|
217
|
+
BoolEqualQInstruction, BoolAndInstruction,
|
218
|
+
BoolDuplicateInstruction, BoolFlushInstruction, BoolFromIntInstruction, BoolNotInstruction,
|
219
|
+
BoolOrInstruction, BoolPopInstruction, BoolRotateInstruction,
|
220
|
+
BoolShoveInstruction, BoolDepthInstruction, BoolSwapInstruction, BoolYankInstruction,
|
221
|
+
BoolYankdupInstruction, BoolXorInstruction],
|
222
|
+
:references => ["x1", "x2"],
|
223
|
+
:types => [IntType, BoolType]
|
224
|
+
)
|
225
|
+
myPointsEvaluator = ProgramPointEvaluator.new(:name => "points")
|
226
|
+
|
227
|
+
myCases = (-10..10).collect do |i|
|
228
|
+
TestCase.new(
|
229
|
+
:bindings => {"x1" => LiteralPoint.new("int",i)},
|
230
|
+
:expectations => {"y" => 2*i*i*i - 8*i*i + 6 * i + 91},
|
231
|
+
:gauges => {"y" => Proc.new {|interp| interp.stacks[:int].peek}}
|
232
|
+
)
|
233
|
+
end
|
234
|
+
|
235
|
+
newGuys = Batch.new
|
236
|
+
10.times do
|
237
|
+
puts "."
|
238
|
+
tourney = mySampler.generate(pop,8) # pick 8 dudes at random from the population
|
239
|
+
tourney = myEvaluator.evaluate(tourney, myCases, deterministic:true) # evaluate them
|
240
|
+
tourney = myPointsEvaluator.evaluate(tourney)
|
241
|
+
|
242
|
+
babies = myCrossover.generate(tourney, 2) # create 2 babies from those
|
243
|
+
babies = myEvaluator.evaluate(babies, myCases, deterministic:true) # evaluate them
|
244
|
+
babies = myPointsEvaluator.evaluate(babies)
|
245
|
+
|
246
|
+
mutantBabies = myMutator.generate(babies, 2) # make 2 mutants of the babies
|
247
|
+
mutantBabies = myEvaluator.evaluate(babies, myCases, deterministic:true) # evaluate
|
248
|
+
mutantBabies = myPointsEvaluator.evaluate(mutantBabies)
|
249
|
+
|
250
|
+
bestInShow = mySelector.generate(tourney + babies + mutantBabies)
|
251
|
+
newGuys += bestInShow # retain only the best
|
252
|
+
end
|
253
|
+
newGuys
|
254
|
+
else
|
255
|
+
Batch.new
|
256
|
+
end
|
257
|
+
end,
|
258
|
+
:promotion_rule => Proc.new {|dude| dude.progress > 30}
|
259
|
+
)
|
260
|
+
|
261
|
+
|
262
|
+
experiment.build_station("level4",
|
263
|
+
:capacity => 100,
|
264
|
+
:generate_rule => Proc.new do |pop|
|
265
|
+
|
266
|
+
if pop.length > 70
|
267
|
+
bw = pop.minmax {|a,b| (a.scores["errors"] || 10000) <=> (b.scores["errors"] || 10000) }
|
268
|
+
bw.each {|dude| puts "#{dude.progress}: #{dude.scores} [#{dude.genome}]\n\n"}
|
269
|
+
mySampler = ResampleAndCloneOperator.new
|
270
|
+
myCrossover = PointCrossoverOperator.new
|
271
|
+
myMutator = PointMutationOperator.new(
|
272
|
+
instructions:[IntAddInstruction, IntSubtractInstruction,
|
273
|
+
IntMultiplyInstruction, IntDivideInstruction],
|
274
|
+
types:[IntType, BoolType],
|
275
|
+
references:["x1","x2"])
|
276
|
+
|
277
|
+
mySelector = NondominatedSubsetSelector.new
|
278
|
+
myEvaluator = TestCaseEvaluator.new(
|
279
|
+
:name => "errors",
|
280
|
+
:instructions =>
|
281
|
+
[IntModuloInstruction, IntMultiplyInstruction, IntAddInstruction,IntSubtractInstruction,
|
282
|
+
IntDivideInstruction, IntLessThanQInstruction, IntEqualQInstruction, IntGreaterThanQInstruction,
|
283
|
+
IntDuplicateInstruction, IntFlushInstruction, IntFromBoolInstruction, IntMaxInstruction,
|
284
|
+
IntMinInstruction, IntPopInstruction, IntRotateInstruction,IntShoveInstruction,
|
285
|
+
IntDepthInstruction, IntSwapInstruction, IntYankInstruction,
|
286
|
+
IntYankdupInstruction,IntAbsInstruction, IntIfInstruction, IntNegativeInstruction,
|
287
|
+
BoolEqualQInstruction, BoolAndInstruction,
|
288
|
+
BoolDuplicateInstruction, BoolFlushInstruction, BoolFromIntInstruction, BoolNotInstruction,
|
289
|
+
BoolOrInstruction, BoolPopInstruction, BoolRotateInstruction,
|
290
|
+
BoolShoveInstruction, BoolDepthInstruction, BoolSwapInstruction, BoolYankInstruction,
|
291
|
+
BoolYankdupInstruction, BoolXorInstruction],
|
292
|
+
:references => ["x1", "x2"],
|
293
|
+
:types => [IntType, BoolType]
|
294
|
+
)
|
295
|
+
myPointsEvaluator = ProgramPointEvaluator.new(:name => "points")
|
296
|
+
|
297
|
+
myCases = (-10..10).collect do |i|
|
298
|
+
TestCase.new(
|
299
|
+
:bindings => {"x1" => LiteralPoint.new("int",i)},
|
300
|
+
:expectations => {"y" => 2*i*i*i - 8*i*i + 6 * i + 91},
|
301
|
+
:gauges => {"y" => Proc.new {|interp| interp.stacks[:int].peek}}
|
302
|
+
)
|
303
|
+
end
|
304
|
+
|
305
|
+
newGuys = Batch.new
|
306
|
+
10.times do
|
307
|
+
puts "."
|
308
|
+
tourney = mySampler.generate(pop,2) # pick 2 dudes at random from the population
|
309
|
+
tourney = myEvaluator.evaluate(tourney, myCases, deterministic:true) # evaluate them
|
310
|
+
tourney = myPointsEvaluator.evaluate(tourney)
|
311
|
+
|
312
|
+
babies = myCrossover.generate(tourney, 10) # create 10 babies from those
|
313
|
+
babies = myEvaluator.evaluate(babies, myCases, deterministic:true) # evaluate them
|
314
|
+
babies = myPointsEvaluator.evaluate(babies)
|
315
|
+
|
316
|
+
mutantBabies = myMutator.generate(babies, 10) # make 10 mutants of the babies
|
317
|
+
mutantBabies = myEvaluator.evaluate(babies, myCases, deterministic:true) # evaluate
|
318
|
+
mutantBabies = myPointsEvaluator.evaluate(mutantBabies)
|
319
|
+
|
320
|
+
bestInShow = mySelector.generate(tourney + babies + mutantBabies)
|
321
|
+
newGuys += bestInShow # retain only the best
|
322
|
+
end
|
323
|
+
newGuys
|
324
|
+
else
|
325
|
+
Batch.new
|
326
|
+
end
|
327
|
+
end,
|
328
|
+
:promotion_rule => Proc.new {|anybody| false}
|
329
|
+
)
|
330
|
+
|
331
|
+
|
332
|
+
|
333
|
+
|
334
|
+
experiment.connect_stations("generator1", "level1")
|
335
|
+
experiment.connect_stations("generator2", "level1")
|
336
|
+
experiment.connect_stations("level1", "level2")
|
337
|
+
experiment.connect_stations("level2", "level3")
|
338
|
+
experiment.connect_stations("level3", "level4")
|
339
|
+
|
340
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,146 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<title>Module: BlockNode [RDoc Documentation]</title>
|
6
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
7
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
8
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
9
|
+
<script type="text/javascript">
|
10
|
+
// <![CDATA[
|
11
|
+
|
12
|
+
function popupCode( url ) {
|
13
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
14
|
+
}
|
15
|
+
|
16
|
+
function toggleCode( id ) {
|
17
|
+
if ( document.getElementById )
|
18
|
+
elem = document.getElementById( id );
|
19
|
+
else if ( document.all )
|
20
|
+
elem = eval( "document.all." + id );
|
21
|
+
else
|
22
|
+
return false;
|
23
|
+
|
24
|
+
elemStyle = elem.style;
|
25
|
+
|
26
|
+
if ( elemStyle.display != "block" ) {
|
27
|
+
elemStyle.display = "block"
|
28
|
+
} else {
|
29
|
+
elemStyle.display = "none"
|
30
|
+
}
|
31
|
+
|
32
|
+
return true;
|
33
|
+
}
|
34
|
+
|
35
|
+
// Make codeblocks hidden by default
|
36
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }<\/style>" )
|
37
|
+
|
38
|
+
// ]]>
|
39
|
+
</script>
|
40
|
+
|
41
|
+
</head>
|
42
|
+
<body>
|
43
|
+
|
44
|
+
|
45
|
+
<div id="classHeader">
|
46
|
+
<table class="header-table">
|
47
|
+
<tr class="top-aligned-row">
|
48
|
+
<td><strong>Module</strong></td>
|
49
|
+
<td class="class-name-in-header">BlockNode</td>
|
50
|
+
</tr>
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>In:</strong></td>
|
53
|
+
<td>
|
54
|
+
|
55
|
+
|
56
|
+
<a href="../files/lib/interpreter/grammars/nudge_language_helpers_rb.html">
|
57
|
+
|
58
|
+
lib/interpreter/grammars/nudge_language_helpers.rb
|
59
|
+
|
60
|
+
</a>
|
61
|
+
|
62
|
+
|
63
|
+
<br />
|
64
|
+
|
65
|
+
</td>
|
66
|
+
</tr>
|
67
|
+
|
68
|
+
|
69
|
+
</table>
|
70
|
+
</div>
|
71
|
+
<!-- banner header -->
|
72
|
+
|
73
|
+
<div id="bodyContent">
|
74
|
+
|
75
|
+
<div id="contextContent">
|
76
|
+
|
77
|
+
<div id="description">
|
78
|
+
<p>
|
79
|
+
coding: utf-8
|
80
|
+
</p>
|
81
|
+
|
82
|
+
</div>
|
83
|
+
|
84
|
+
</div>
|
85
|
+
|
86
|
+
|
87
|
+
<div id="method-list">
|
88
|
+
<h3 class="section-bar">Methods</h3>
|
89
|
+
|
90
|
+
<div class="name-list">
|
91
|
+
|
92
|
+
<a href="#M000246">to_points</a>
|
93
|
+
|
94
|
+
</div>
|
95
|
+
</div>
|
96
|
+
|
97
|
+
</div>
|
98
|
+
|
99
|
+
<!-- if includes -->
|
100
|
+
|
101
|
+
<div id="section">
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
<!-- if method_list -->
|
107
|
+
|
108
|
+
<div id="methods">
|
109
|
+
|
110
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
111
|
+
|
112
|
+
|
113
|
+
<div id="method-M000246" class="method-detail">
|
114
|
+
<a name="M000246"></a>
|
115
|
+
|
116
|
+
<div class="method-heading">
|
117
|
+
|
118
|
+
<a href="BlockNode.src/M000246.html" target="Code" class="method-signature"
|
119
|
+
onclick="popupCode('BlockNode.src/M000246.html');return false;">
|
120
|
+
|
121
|
+
<span class="method-name">to_points</span><span class="method-args">()</span>
|
122
|
+
|
123
|
+
</a>
|
124
|
+
|
125
|
+
</div>
|
126
|
+
|
127
|
+
<div class="method-description">
|
128
|
+
|
129
|
+
</div>
|
130
|
+
</div>
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
</div>
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
</div>
|
140
|
+
|
141
|
+
<div id="validator-badges">
|
142
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
143
|
+
</div>
|
144
|
+
|
145
|
+
</body>
|
146
|
+
</html>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<title>to_points (BlockNode)</title>
|
6
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
7
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
8
|
+
</head>
|
9
|
+
<body class="standalone-code">
|
10
|
+
<pre><span class="ruby-comment cmt"># File lib/interpreter/grammars/nudge_language_helpers.rb, line 3</span>
|
11
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_points</span>
|
12
|
+
<span class="ruby-identifier">newBlob</span> = <span class="ruby-constant">CodeBlock</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">text_value</span>)
|
13
|
+
<span class="ruby-identifier">newBlob</span>.<span class="ruby-identifier">contents</span> = <span class="ruby-identifier">innards</span>.<span class="ruby-identifier">elements</span>.<span class="ruby-identifier">collect</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">item</span><span class="ruby-operator">|</span> <span class="ruby-identifier">item</span>.<span class="ruby-identifier">to_points</span>}
|
14
|
+
<span class="ruby-identifier">newBlob</span>.<span class="ruby-identifier">listing</span> = <span class="ruby-identifier">newBlob</span>.<span class="ruby-identifier">tidy</span>
|
15
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">newBlob</span>
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|