diff --git a/iDNA.xcodeproj/project.pbxproj b/iDNA.xcodeproj/project.pbxproj new file mode 100644 index 0000000..8505453 --- /dev/null +++ b/iDNA.xcodeproj/project.pbxproj @@ -0,0 +1,317 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 491D6B861699E87B009AF1BD /* Cell.m in Sources */ = {isa = PBXBuildFile; fileRef = 491D6B851699E87B009AF1BD /* Cell.m */; }; + 491D6B8A169A015A009AF1BD /* Population.m in Sources */ = {isa = PBXBuildFile; fileRef = 491D6B89169A015A009AF1BD /* Population.m */; }; + 49923F78168A3B7F00B01226 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 49923F77168A3B7F00B01226 /* Cocoa.framework */; }; + 49923F82168A3B7F00B01226 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 49923F80168A3B7F00B01226 /* InfoPlist.strings */; }; + 49923F84168A3B7F00B01226 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 49923F83168A3B7F00B01226 /* main.m */; }; + 49923F88168A3B7F00B01226 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 49923F86168A3B7F00B01226 /* Credits.rtf */; }; + 49923F8B168A3B7F00B01226 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 49923F8A168A3B7F00B01226 /* AppDelegate.m */; }; + 49923F8E168A3B7F00B01226 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 49923F8C168A3B7F00B01226 /* MainMenu.xib */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 491D6B841699E87B009AF1BD /* Cell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Cell.h; sourceTree = ""; }; + 491D6B851699E87B009AF1BD /* Cell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Cell.m; sourceTree = ""; }; + 491D6B88169A015A009AF1BD /* Population.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Population.h; sourceTree = ""; }; + 491D6B89169A015A009AF1BD /* Population.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Population.m; sourceTree = ""; }; + 49923F73168A3B7F00B01226 /* iDNA.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iDNA.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 49923F77168A3B7F00B01226 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; + 49923F7A168A3B7F00B01226 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; + 49923F7B168A3B7F00B01226 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; + 49923F7C168A3B7F00B01226 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 49923F7F168A3B7F00B01226 /* iDNA-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "iDNA-Info.plist"; sourceTree = ""; }; + 49923F81168A3B7F00B01226 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 49923F83168A3B7F00B01226 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 49923F85168A3B7F00B01226 /* iDNA-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "iDNA-Prefix.pch"; sourceTree = ""; }; + 49923F87168A3B7F00B01226 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = ""; }; + 49923F89168A3B7F00B01226 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 49923F8A168A3B7F00B01226 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 49923F8D168A3B7F00B01226 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 49923F70168A3B7F00B01226 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 49923F78168A3B7F00B01226 /* Cocoa.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 49923F68168A3B7F00B01226 = { + isa = PBXGroup; + children = ( + 49923F7D168A3B7F00B01226 /* iDNA */, + 49923F76168A3B7F00B01226 /* Frameworks */, + 49923F74168A3B7F00B01226 /* Products */, + ); + sourceTree = ""; + }; + 49923F74168A3B7F00B01226 /* Products */ = { + isa = PBXGroup; + children = ( + 49923F73168A3B7F00B01226 /* iDNA.app */, + ); + name = Products; + sourceTree = ""; + }; + 49923F76168A3B7F00B01226 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 49923F77168A3B7F00B01226 /* Cocoa.framework */, + 49923F79168A3B7F00B01226 /* Other Frameworks */, + ); + name = Frameworks; + sourceTree = ""; + }; + 49923F79168A3B7F00B01226 /* Other Frameworks */ = { + isa = PBXGroup; + children = ( + 49923F7A168A3B7F00B01226 /* AppKit.framework */, + 49923F7B168A3B7F00B01226 /* CoreData.framework */, + 49923F7C168A3B7F00B01226 /* Foundation.framework */, + ); + name = "Other Frameworks"; + sourceTree = ""; + }; + 49923F7D168A3B7F00B01226 /* iDNA */ = { + isa = PBXGroup; + children = ( + 49923F89168A3B7F00B01226 /* AppDelegate.h */, + 49923F8A168A3B7F00B01226 /* AppDelegate.m */, + 491D6B841699E87B009AF1BD /* Cell.h */, + 491D6B851699E87B009AF1BD /* Cell.m */, + 491D6B88169A015A009AF1BD /* Population.h */, + 491D6B89169A015A009AF1BD /* Population.m */, + 49923F8C168A3B7F00B01226 /* MainMenu.xib */, + 49923F7E168A3B7F00B01226 /* Supporting Files */, + ); + path = iDNA; + sourceTree = ""; + }; + 49923F7E168A3B7F00B01226 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 49923F7F168A3B7F00B01226 /* iDNA-Info.plist */, + 49923F80168A3B7F00B01226 /* InfoPlist.strings */, + 49923F83168A3B7F00B01226 /* main.m */, + 49923F85168A3B7F00B01226 /* iDNA-Prefix.pch */, + 49923F86168A3B7F00B01226 /* Credits.rtf */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 49923F72168A3B7F00B01226 /* iDNA */ = { + isa = PBXNativeTarget; + buildConfigurationList = 49923F91168A3B7F00B01226 /* Build configuration list for PBXNativeTarget "iDNA" */; + buildPhases = ( + 49923F6F168A3B7F00B01226 /* Sources */, + 49923F70168A3B7F00B01226 /* Frameworks */, + 49923F71168A3B7F00B01226 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = iDNA; + productName = iDNA; + productReference = 49923F73168A3B7F00B01226 /* iDNA.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 49923F6A168A3B7F00B01226 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0450; + ORGANIZATIONNAME = "Роман Евсеев"; + }; + buildConfigurationList = 49923F6D168A3B7F00B01226 /* Build configuration list for PBXProject "iDNA" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 49923F68168A3B7F00B01226; + productRefGroup = 49923F74168A3B7F00B01226 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 49923F72168A3B7F00B01226 /* iDNA */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 49923F71168A3B7F00B01226 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 49923F82168A3B7F00B01226 /* InfoPlist.strings in Resources */, + 49923F88168A3B7F00B01226 /* Credits.rtf in Resources */, + 49923F8E168A3B7F00B01226 /* MainMenu.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 49923F6F168A3B7F00B01226 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 49923F84168A3B7F00B01226 /* main.m in Sources */, + 49923F8B168A3B7F00B01226 /* AppDelegate.m in Sources */, + 491D6B861699E87B009AF1BD /* Cell.m in Sources */, + 491D6B8A169A015A009AF1BD /* Population.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 49923F80168A3B7F00B01226 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 49923F81168A3B7F00B01226 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 49923F86168A3B7F00B01226 /* Credits.rtf */ = { + isa = PBXVariantGroup; + children = ( + 49923F87168A3B7F00B01226 /* en */, + ); + name = Credits.rtf; + sourceTree = ""; + }; + 49923F8C168A3B7F00B01226 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 49923F8D168A3B7F00B01226 /* en */, + ); + name = MainMenu.xib; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 49923F8F168A3B7F00B01226 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.7; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + 49923F90168A3B7F00B01226 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.7; + SDKROOT = macosx; + }; + name = Release; + }; + 49923F92168A3B7F00B01226 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "iDNA/iDNA-Prefix.pch"; + INFOPLIST_FILE = "iDNA/iDNA-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 49923F93168A3B7F00B01226 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "iDNA/iDNA-Prefix.pch"; + INFOPLIST_FILE = "iDNA/iDNA-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 49923F6D168A3B7F00B01226 /* Build configuration list for PBXProject "iDNA" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 49923F8F168A3B7F00B01226 /* Debug */, + 49923F90168A3B7F00B01226 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 49923F91168A3B7F00B01226 /* Build configuration list for PBXNativeTarget "iDNA" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 49923F92168A3B7F00B01226 /* Debug */, + 49923F93168A3B7F00B01226 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 49923F6A168A3B7F00B01226 /* Project object */; +} diff --git a/iDNA.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/iDNA.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..2d38afe --- /dev/null +++ b/iDNA.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/iDNA.xcodeproj/project.xcworkspace/xcuserdata/rsevseev.xcuserdatad/UserInterfaceState.xcuserstate b/iDNA.xcodeproj/project.xcworkspace/xcuserdata/rsevseev.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..7c01a33 Binary files /dev/null and b/iDNA.xcodeproj/project.xcworkspace/xcuserdata/rsevseev.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/iDNA.xcodeproj/xcuserdata/rsevseev.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/iDNA.xcodeproj/xcuserdata/rsevseev.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist new file mode 100644 index 0000000..05301bc --- /dev/null +++ b/iDNA.xcodeproj/xcuserdata/rsevseev.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/iDNA.xcodeproj/xcuserdata/rsevseev.xcuserdatad/xcschemes/iDNA.xcscheme b/iDNA.xcodeproj/xcuserdata/rsevseev.xcuserdatad/xcschemes/iDNA.xcscheme new file mode 100644 index 0000000..e826964 --- /dev/null +++ b/iDNA.xcodeproj/xcuserdata/rsevseev.xcuserdatad/xcschemes/iDNA.xcscheme @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/iDNA.xcodeproj/xcuserdata/rsevseev.xcuserdatad/xcschemes/xcschememanagement.plist b/iDNA.xcodeproj/xcuserdata/rsevseev.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..6ed9663 --- /dev/null +++ b/iDNA.xcodeproj/xcuserdata/rsevseev.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + iDNA.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 49923F72168A3B7F00B01226 + + primary + + + + + diff --git a/iDNA/AppDelegate.h b/iDNA/AppDelegate.h new file mode 100644 index 0000000..38757e6 --- /dev/null +++ b/iDNA/AppDelegate.h @@ -0,0 +1,37 @@ +// +// AppDelegate.h +// iDNA +// +// Created by Роман Евсеев on 25.12.12. +// Copyright (c) 2012 Роман Евсеев. All rights reserved. +// + +#import +#import "Population.h" +@interface AppDelegate : NSObject + +@property (weak) IBOutlet NSTextField *textPopulationSize; +@property (weak) IBOutlet NSTextField *textDNALength; +@property (weak) IBOutlet NSTextField *textMutationRate; +@property (weak) IBOutlet NSTextField *textGoalDNA; +@property (assign) IBOutlet NSWindow *window; +@property (weak) IBOutlet NSButton *btnStartEvolution; +@property (weak) IBOutlet NSButton *btnPause; +@property (weak) IBOutlet NSButton *btnLoadGoalDNA; +@property (weak) IBOutlet NSTextField *lblGeneration; +@property (weak) IBOutlet NSTextField *lblBestMatch; +@property (weak) IBOutlet NSSliderCell *sliderDNALength; +@property (weak) IBOutlet NSSlider *sliderPopulationSize; +@property (weak) IBOutlet NSSlider *sliderMutationRate; + +@property Population * population; + +- (IBAction)startEvolution:(id)sender; +- (IBAction)pause:(id)sender; +- (IBAction)loadGoalDNA:(id)sender; +- (IBAction)changedDNA:(id)sender; +- (IBAction)changedPopulation:(id)sender; +- (IBAction)changedMutationRate:(id)sender; + +- (void) evolution: (id)sender; +@end diff --git a/iDNA/AppDelegate.m b/iDNA/AppDelegate.m new file mode 100644 index 0000000..5c28e57 --- /dev/null +++ b/iDNA/AppDelegate.m @@ -0,0 +1,90 @@ +// +// AppDelegate.m +// iDNA +// +// Created by Роман Евсеев on 25.12.12. +// Copyright (c) 2012 Роман Евсеев. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (void)applicationDidFinishLaunching:(NSNotification *)aNotification +{ + [self loadGoalDNA:self]; +} + +-(void)evolution:(id)sender { + while (!self.population.evolution && self.btnPause.isEnabled) { + [_lblBestMatch setStringValue: + [NSString stringWithFormat: @"Best match: %li", self.population.bestMatch]]; + [_lblGeneration setStringValue: + [NSString stringWithFormat: @"Generation: %li", self.population.step]]; + } + + [_lblBestMatch setStringValue: + [NSString stringWithFormat: @"Best match: %li", self.population.bestMatch]]; + [_lblGeneration setStringValue: + [NSString stringWithFormat: @"Generation: %li", self.population.step]]; + + [self pause:self]; +} + +- (IBAction)startEvolution:(id)sender { + [_btnPause setEnabled:YES]; + [_btnStartEvolution setEnabled:NO]; + [_btnLoadGoalDNA setEnabled:NO]; + + [_textPopulationSize setEnabled:NO]; + [_textDNALength setEnabled:NO]; + [_textMutationRate setEnabled:NO]; + [self performSelectorInBackground:@selector(evolution:) withObject:self]; +} + +- (IBAction)pause:(id)sender { + [_btnPause setEnabled:NO]; + [_btnStartEvolution setEnabled:YES]; + [_btnLoadGoalDNA setEnabled:YES]; + + [_textPopulationSize setEnabled:YES]; + [_textDNALength setEnabled:YES]; + [_textMutationRate setEnabled:YES]; +} + +- (IBAction)loadGoalDNA:(id)sender { + _population = [[Population alloc] initWithCapacity:[_textPopulationSize integerValue] DNALength:[_textDNALength integerValue]]; + [_textGoalDNA setStringValue:[self.population.goalDNA description]]; + [_lblBestMatch setStringValue:@""]; + [_lblGeneration setStringValue:@""]; +} + +- (IBAction)changedDNA:(id)sender { + NSUInteger val = [(NSTextField *)sender integerValue]; + if (val>[_sliderDNALength maxValue]) { + val = [_sliderDNALength maxValue]; + } + [_textDNALength setIntegerValue:val]; + [_sliderDNALength setIntegerValue:val]; + [self loadGoalDNA:self]; +} + +-(void)changedPopulation:(id)sender { + NSUInteger val = [(NSTextField *)sender integerValue]; + if (val>[_sliderPopulationSize maxValue]) { + val = [_sliderPopulationSize maxValue]; + } + [_textPopulationSize setIntegerValue:val]; + [_sliderPopulationSize setIntegerValue:val]; +} + +-(void)changedMutationRate:(id)sender { + NSUInteger val = [(NSTextField *)sender integerValue]; + if (val>[_sliderMutationRate maxValue]) { + val = [_sliderMutationRate maxValue]; + } + [_textMutationRate setIntegerValue:val]; + [_sliderMutationRate setIntegerValue:val]; +} + +@end diff --git a/iDNA/Cell.h b/iDNA/Cell.h new file mode 100644 index 0000000..24bbe85 --- /dev/null +++ b/iDNA/Cell.h @@ -0,0 +1,34 @@ +// +// Cell.h +// iDNA +// +// Created by Роман Евсеев on 06.01.13. +// Copyright (c) 2013 Роман Евсеев. All rights reserved. +// + +#import + +@interface Cell : NSObject { + NSMutableArray * DNA; +} + +@property (nonatomic, readonly) NSMutableArray * DNA; +@property (readonly) NSUInteger lastDistance; + +- (id) initWithCapacity: (NSUInteger) capacity; +- (id) initWithString: (NSString *) string; ++ (Cell *) cellWithString: (NSString *) string; + +- (NSUInteger) hammingDistance: (Cell *) cell; +- (void) mutate: (NSUInteger) percent; + ++(NSString *) mixMethod1: (NSString *) stringOne withString: (NSString *) stringTwo; ++(NSString *) mixMethod2: (NSString *) stringOne withString: (NSString *) stringTwo; ++(NSString *) mixMethod3: (NSString *) stringOne withString: (NSString *) stringTwo; + ++ (NSArray *) getElements; ++ (NSString *) randomElementWithout: (NSString *) element; + ++ (NSString *) mixString: (NSString *) stringOne withString: (NSString *) stringTwo; + +@end diff --git a/iDNA/Cell.m b/iDNA/Cell.m new file mode 100644 index 0000000..1e982d4 --- /dev/null +++ b/iDNA/Cell.m @@ -0,0 +1,132 @@ +// +// Cell.m +// iDNA +// +// Created by Роман Евсеев on 06.01.13. +// Copyright (c) 2013 Роман Евсеев. All rights reserved. +// + +#import "Cell.h" + +@implementation Cell + +- (id) initWithCapacity:(NSUInteger)capacity { + if (self = [super init]) { + DNA = [[NSMutableArray alloc] initWithCapacity:capacity]; + for (int i=0; i100) { + [NSException raise:@"Invalid value" format:@"Value must be in range [0..100]"]; + } + NSMutableSet * positions = [[NSMutableSet alloc] init]; + int X = [DNA count]*percent/100; + + while ([positions count] +#import "Cell.h" + +@interface Population : NSObject + +@property NSMutableArray * cells; +@property Cell * goalDNA; +@property (readonly) NSUInteger step; +@property (readonly) NSUInteger count; +@property NSUInteger mutationRate; +@property (readonly) NSUInteger bestMatch; +- (id) initWithCapacity: (NSUInteger) capacity DNALength: (NSUInteger) len; +- (BOOL) evolution; +@end diff --git a/iDNA/Population.m b/iDNA/Population.m new file mode 100644 index 0000000..2824528 --- /dev/null +++ b/iDNA/Population.m @@ -0,0 +1,59 @@ +// +// Population.m +// iDNA +// +// Created by Роман Евсеев on 06.01.13. +// Copyright (c) 2013 Роман Евсеев. All rights reserved. +// + +#import "Population.h" + +@implementation Population + +-(id)initWithCapacity:(NSUInteger)capacity DNALength:(NSUInteger)len { + Cell * cell; + if (self = [super init]) { + _step = 0; + _count = 0; + _mutationRate = 10; + _cells = [[NSMutableArray alloc] initWithCapacity:capacity]; + _goalDNA = [[Cell alloc] initWithCapacity:len]; + for (int i = 0; i + + + 1070 + 11G63 + 2844 + 1138.51 + 569.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 2844 + + + NSBox + NSButton + NSButtonCell + NSCustomObject + NSMenu + NSMenuItem + NSSlider + NSSliderCell + NSTextField + NSTextFieldCell + NSView + NSWindowTemplate + + + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + + NSApplication + + + FirstResponder + + + NSApplication + + + AMainMenu + + + + iDNA + + 1048576 + 2147483647 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + submenuAction: + + iDNA + + + + About iDNA + + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Preferences… + , + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Services + + 1048576 + 2147483647 + + + submenuAction: + + Services + + _NSServicesMenu + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Hide iDNA + h + 1048576 + 2147483647 + + + + + + Hide Others + h + 1572864 + 2147483647 + + + + + + Show All + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Quit iDNA + q + 1048576 + 2147483647 + + + + + _NSAppleMenu + + + + + File + + 1048576 + 2147483647 + + + submenuAction: + + File + + + + New + n + 1048576 + 2147483647 + + + + + + Open… + o + 1048576 + 2147483647 + + + + + + Open Recent + + 1048576 + 2147483647 + + + submenuAction: + + Open Recent + + + + Clear Menu + + 1048576 + 2147483647 + + + + + _NSRecentDocumentsMenu + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Close + w + 1048576 + 2147483647 + + + + + + Save… + s + 1048576 + 2147483647 + + + + + + Revert to Saved + + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Page Setup... + P + 1179648 + 2147483647 + + + + + + + Print… + p + 1048576 + 2147483647 + + + + + + + + + Edit + + 1048576 + 2147483647 + + + submenuAction: + + Edit + + + + Undo + z + 1048576 + 2147483647 + + + + + + Redo + Z + 1179648 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Cut + x + 1048576 + 2147483647 + + + + + + Copy + c + 1048576 + 2147483647 + + + + + + Paste + v + 1048576 + 2147483647 + + + + + + Paste and Match Style + V + 1572864 + 2147483647 + + + + + + Delete + + 1048576 + 2147483647 + + + + + + Select All + a + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Find + + 1048576 + 2147483647 + + + submenuAction: + + Find + + + + Find… + f + 1048576 + 2147483647 + + + 1 + + + + Find and Replace… + f + 1572864 + 2147483647 + + + 12 + + + + Find Next + g + 1048576 + 2147483647 + + + 2 + + + + Find Previous + G + 1179648 + 2147483647 + + + 3 + + + + Use Selection for Find + e + 1048576 + 2147483647 + + + 7 + + + + Jump to Selection + j + 1048576 + 2147483647 + + + + + + + + + Spelling and Grammar + + 1048576 + 2147483647 + + + submenuAction: + + Spelling and Grammar + + + + Show Spelling and Grammar + : + 1048576 + 2147483647 + + + + + + Check Document Now + ; + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Check Spelling While Typing + + 1048576 + 2147483647 + + + + + + Check Grammar With Spelling + + 1048576 + 2147483647 + + + + + + Correct Spelling Automatically + + 2147483647 + + + + + + + + + Substitutions + + 1048576 + 2147483647 + + + submenuAction: + + Substitutions + + + + Show Substitutions + + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Smart Copy/Paste + f + 1048576 + 2147483647 + + + 1 + + + + Smart Quotes + g + 1048576 + 2147483647 + + + 2 + + + + Smart Dashes + + 2147483647 + + + + + + Smart Links + G + 1179648 + 2147483647 + + + 3 + + + + Text Replacement + + 2147483647 + + + + + + + + + Transformations + + 2147483647 + + + submenuAction: + + Transformations + + + + Make Upper Case + + 2147483647 + + + + + + Make Lower Case + + 2147483647 + + + + + + Capitalize + + 2147483647 + + + + + + + + + Speech + + 1048576 + 2147483647 + + + submenuAction: + + Speech + + + + Start Speaking + + 1048576 + 2147483647 + + + + + + Stop Speaking + + 1048576 + 2147483647 + + + + + + + + + + + + Format + + 2147483647 + + + submenuAction: + + Format + + + + Font + + 2147483647 + + + submenuAction: + + Font + + + + Show Fonts + t + 1048576 + 2147483647 + + + + + + Bold + b + 1048576 + 2147483647 + + + 2 + + + + Italic + i + 1048576 + 2147483647 + + + 1 + + + + Underline + u + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Bigger + + + 1048576 + 2147483647 + + + 3 + + + + Smaller + - + 1048576 + 2147483647 + + + 4 + + + + YES + YES + + + 2147483647 + + + + + + Kern + + 2147483647 + + + submenuAction: + + Kern + + + + Use Default + + 2147483647 + + + + + + Use None + + 2147483647 + + + + + + Tighten + + 2147483647 + + + + + + Loosen + + 2147483647 + + + + + + + + + Ligatures + + 2147483647 + + + submenuAction: + + Ligatures + + + + Use Default + + 2147483647 + + + + + + Use None + + 2147483647 + + + + + + Use All + + 2147483647 + + + + + + + + + Baseline + + 2147483647 + + + submenuAction: + + Baseline + + + + Use Default + + 2147483647 + + + + + + Superscript + + 2147483647 + + + + + + Subscript + + 2147483647 + + + + + + Raise + + 2147483647 + + + + + + Lower + + 2147483647 + + + + + + + + + YES + YES + + + 2147483647 + + + + + + Show Colors + C + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Copy Style + c + 1572864 + 2147483647 + + + + + + Paste Style + v + 1572864 + 2147483647 + + + + + _NSFontMenu + + + + + Text + + 2147483647 + + + submenuAction: + + Text + + + + Align Left + { + 1048576 + 2147483647 + + + + + + Center + | + 1048576 + 2147483647 + + + + + + Justify + + 2147483647 + + + + + + Align Right + } + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Writing Direction + + 2147483647 + + + submenuAction: + + Writing Direction + + + + YES + Paragraph + + 2147483647 + + + + + + CURlZmF1bHQ + + 2147483647 + + + + + + CUxlZnQgdG8gUmlnaHQ + + 2147483647 + + + + + + CVJpZ2h0IHRvIExlZnQ + + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + YES + Selection + + 2147483647 + + + + + + CURlZmF1bHQ + + 2147483647 + + + + + + CUxlZnQgdG8gUmlnaHQ + + 2147483647 + + + + + + CVJpZ2h0IHRvIExlZnQ + + 2147483647 + + + + + + + + + YES + YES + + + 2147483647 + + + + + + Show Ruler + + 2147483647 + + + + + + Copy Ruler + c + 1310720 + 2147483647 + + + + + + Paste Ruler + v + 1310720 + 2147483647 + + + + + + + + + + + + View + + 1048576 + 2147483647 + + + submenuAction: + + View + + + + Show Toolbar + t + 1572864 + 2147483647 + + + + + + Customize Toolbar… + + 1048576 + 2147483647 + + + + + + + + + Window + + 1048576 + 2147483647 + + + submenuAction: + + Window + + + + Minimize + m + 1048576 + 2147483647 + + + + + + Zoom + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Bring All to Front + + 1048576 + 2147483647 + + + + + _NSWindowsMenu + + + + + Help + + 2147483647 + + + submenuAction: + + Help + + + + iDNA Help + ? + 1048576 + 2147483647 + + + + + _NSHelpMenu + + + + _NSMainMenu + + + 15 + 2 + {{361, 229}, {485, 380}} + 1954021376 + iDNA + NSWindow + + + {485, 380} + + + 256 + + + + 268 + {{17, 343}, {101, 17}} + + + + _NS:1535 + YES + + 68157504 + 272630784 + Population size + + LucidaGrande + 13 + 1044 + + _NS:1535 + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + + + + 268 + {{17, 318}, {77, 17}} + + + + _NS:1535 + YES + + 68157504 + 272630784 + DNA length + + _NS:1535 + + + + + + + + 268 + {{17, 293}, {102, 17}} + + + + _NS:1535 + YES + + 68157504 + 272630784 + Mutation rate % + + _NS:1535 + + + + + + + + 266 + {{188, 340}, {279, 21}} + + + + _NS:9 + YES + + -2080112384 + 0 + + _NS:9 + + 1000 + 1 + 10 + 0.0 + 0 + 1 + NO + NO + + + + + 266 + {{188, 315}, {279, 21}} + + + + _NS:9 + YES + + -2080112384 + 0 + + _NS:9 + + 200 + 1 + 20 + 0.0 + 0 + 1 + NO + NO + + + + + 266 + {{188, 290}, {279, 21}} + + + + _NS:9 + YES + + -2080112384 + 0 + + _NS:9 + + 100 + 1 + 30 + 0.0 + 0 + 1 + NO + NO + + + + + 268 + {{123, 340}, {59, 22}} + + + + _NS:9 + YES + + -1804599231 + 71304192 + 10 + + _NS:9 + + YES + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 6 + System + textColor + + + + + + + 268 + {{123, 315}, {59, 22}} + + + + _NS:9 + YES + + -1804599231 + 71304192 + 20 + + _NS:9 + + YES + + + + + + + 268 + {{123, 290}, {59, 22}} + + + + _NS:9 + YES + + -1804599231 + 71304192 + 30 + + _NS:9 + + YES + + + + + + + 266 + {{17, 262}, {451, 17}} + + + + _NS:1535 + YES + + 68157504 + 138413056 + Generation: + + LucidaGrande-Bold + 13 + 16 + + _NS:1535 + + + + + + + + 266 + {{17, 237}, {451, 17}} + + + + _NS:1535 + YES + + 68157504 + 138413056 + Best individual match - + + _NS:1535 + + + + + + + + 18 + + + + 274 + + + + 274 + {{18, 16}, {413, 116}} + + + + _NS:9 + YES + + -1268776959 + 272630272 + + + _NS:9 + + YES + + + + + + + 266 + {{23, 140}, {411, 17}} + + + + _NS:1535 + YES + + 68157504 + 138413056 + Goal DNA + + _NS:1535 + + + + + + + {{1, 1}, {449, 157}} + + + + _NS:11 + + + {{17, 56}, {451, 173}} + + + + _NS:9 + {0, 0} + + 67108864 + 0 + + + LucidaGrande + 11 + 3100 + + + + 3 + MCAwLjgwMDAwMDAxMTkAA + + + + 1 + 0 + 2 + NO + + + + 292 + {{14, 12}, {132, 32}} + + + + _NS:9 + YES + + 67108864 + 134217728 + Start Evolution + + _NS:9 + + -2038284288 + 129 + + + 200 + 25 + + + + + 292 + {{146, 12}, {77, 32}} + + + + _NS:9 + YES + + 603979776 + 134217728 + Pause + + _NS:9 + + -2038284288 + 129 + + + 200 + 25 + + + + + 289 + {{337, 12}, {134, 32}} + + + + _NS:9 + YES + + 67108864 + 134217728 + Load goal DNA + + _NS:9 + + -2038284288 + 129 + + + 200 + 25 + + + + {485, 380} + + + + + {{0, 0}, {1280, 778}} + {485, 402} + {10000000000000, 10000000000000} + YES + + + AppDelegate + + + NSFontManager + + + + + + + terminate: + + + + 449 + + + + orderFrontStandardAboutPanel: + + + + 142 + + + + delegate + + + + 495 + + + + performMiniaturize: + + + + 37 + + + + arrangeInFront: + + + + 39 + + + + print: + + + + 86 + + + + runPageLayout: + + + + 87 + + + + clearRecentDocuments: + + + + 127 + + + + performClose: + + + + 193 + + + + toggleContinuousSpellChecking: + + + + 222 + + + + undo: + + + + 223 + + + + copy: + + + + 224 + + + + checkSpelling: + + + + 225 + + + + paste: + + + + 226 + + + + stopSpeaking: + + + + 227 + + + + cut: + + + + 228 + + + + showGuessPanel: + + + + 230 + + + + redo: + + + + 231 + + + + selectAll: + + + + 232 + + + + startSpeaking: + + + + 233 + + + + delete: + + + + 235 + + + + performZoom: + + + + 240 + + + + performFindPanelAction: + + + + 241 + + + + centerSelectionInVisibleArea: + + + + 245 + + + + toggleGrammarChecking: + + + + 347 + + + + toggleSmartInsertDelete: + + + + 355 + + + + toggleAutomaticQuoteSubstitution: + + + + 356 + + + + toggleAutomaticLinkDetection: + + + + 357 + + + + saveDocument: + + + + 362 + + + + revertDocumentToSaved: + + + + 364 + + + + runToolbarCustomizationPalette: + + + + 365 + + + + toggleToolbarShown: + + + + 366 + + + + hide: + + + + 367 + + + + hideOtherApplications: + + + + 368 + + + + unhideAllApplications: + + + + 370 + + + + newDocument: + + + + 373 + + + + openDocument: + + + + 374 + + + + raiseBaseline: + + + + 426 + + + + lowerBaseline: + + + + 427 + + + + copyFont: + + + + 428 + + + + subscript: + + + + 429 + + + + superscript: + + + + 430 + + + + tightenKerning: + + + + 431 + + + + underline: + + + + 432 + + + + orderFrontColorPanel: + + + + 433 + + + + useAllLigatures: + + + + 434 + + + + loosenKerning: + + + + 435 + + + + pasteFont: + + + + 436 + + + + unscript: + + + + 437 + + + + useStandardKerning: + + + + 438 + + + + useStandardLigatures: + + + + 439 + + + + turnOffLigatures: + + + + 440 + + + + turnOffKerning: + + + + 441 + + + + toggleAutomaticSpellingCorrection: + + + + 456 + + + + orderFrontSubstitutionsPanel: + + + + 458 + + + + toggleAutomaticDashSubstitution: + + + + 461 + + + + toggleAutomaticTextReplacement: + + + + 463 + + + + uppercaseWord: + + + + 464 + + + + capitalizeWord: + + + + 467 + + + + lowercaseWord: + + + + 468 + + + + pasteAsPlainText: + + + + 486 + + + + performFindPanelAction: + + + + 487 + + + + performFindPanelAction: + + + + 488 + + + + performFindPanelAction: + + + + 489 + + + + showHelp: + + + + 493 + + + + alignCenter: + + + + 518 + + + + pasteRuler: + + + + 519 + + + + toggleRuler: + + + + 520 + + + + alignRight: + + + + 521 + + + + copyRuler: + + + + 522 + + + + alignJustified: + + + + 523 + + + + alignLeft: + + + + 524 + + + + makeBaseWritingDirectionNatural: + + + + 525 + + + + makeBaseWritingDirectionLeftToRight: + + + + 526 + + + + makeBaseWritingDirectionRightToLeft: + + + + 527 + + + + makeTextWritingDirectionNatural: + + + + 528 + + + + makeTextWritingDirectionLeftToRight: + + + + 529 + + + + makeTextWritingDirectionRightToLeft: + + + + 530 + + + + performFindPanelAction: + + + + 535 + + + + addFontTrait: + + + + 421 + + + + addFontTrait: + + + + 422 + + + + modifyFont: + + + + 423 + + + + orderFrontFontPanel: + + + + 424 + + + + modifyFont: + + + + 425 + + + + window + + + + 532 + + + + textDNALength + + + + 761 + + + + textPopulationSize + + + + 762 + + + + startEvolution: + + + + 764 + + + + pause: + + + + 765 + + + + loadGoalDNA: + + + + 766 + + + + btnStartEvolution + + + + 767 + + + + btnPause + + + + 768 + + + + btnLoadGoalDNA + + + + 769 + + + + lblGeneration + + + + 770 + + + + lblBestMatch + + + + 771 + + + + textMutationRate + + + + 772 + + + + textGoalDNA + + + + 773 + + + + changedDNA: + + + + 791 + + + + changedDNA: + + + + 792 + + + + sliderDNALength + + + + 793 + + + + sliderPopulationSize + + + + 794 + + + + sliderMutationRate + + + + 795 + + + + changedPopulation: + + + + 796 + + + + changedPopulation: + + + + 797 + + + + changedMutationRate: + + + + 798 + + + + changedMutationRate: + + + + 799 + + + + + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 29 + + + + + + + + + + + + + + 19 + + + + + + + + 56 + + + + + + + + 217 + + + + + + + + 83 + + + + + + + + 81 + + + + + + + + + + + + + + + + + 75 + + + + + 78 + + + + + 72 + + + + + 82 + + + + + 124 + + + + + + + + 77 + + + + + 73 + + + + + 79 + + + + + 112 + + + + + 74 + + + + + 125 + + + + + + + + 126 + + + + + 205 + + + + + + + + + + + + + + + + + + + + + + 202 + + + + + 198 + + + + + 207 + + + + + 214 + + + + + 199 + + + + + 203 + + + + + 197 + + + + + 206 + + + + + 215 + + + + + 218 + + + + + + + + 216 + + + + + + + + 200 + + + + + + + + + + + + + 219 + + + + + 201 + + + + + 204 + + + + + 220 + + + + + + + + + + + + + 213 + + + + + 210 + + + + + 221 + + + + + 208 + + + + + 209 + + + + + 57 + + + + + + + + + + + + + + + + + + 58 + + + + + 134 + + + + + 150 + + + + + 136 + + + + + 144 + + + + + 129 + + + + + 143 + + + + + 236 + + + + + 131 + + + + + + + + 149 + + + + + 145 + + + + + 130 + + + + + 24 + + + + + + + + + + + 92 + + + + + 5 + + + + + 239 + + + + + 23 + + + + + 295 + + + + + + + + 296 + + + + + + + + + 297 + + + + + 298 + + + + + 211 + + + + + + + + 212 + + + + + + + + + 195 + + + + + 196 + + + + + 346 + + + + + 348 + + + + + + + + 349 + + + + + + + + + + + + + + 350 + + + + + 351 + + + + + 354 + + + + + 371 + + + + + + + + 372 + + + + + + + + + + + + + + + + + + + + + + 375 + + + + + + + + 376 + + + + + + + + + 377 + + + + + + + + 388 + + + + + + + + + + + + + + + + + + + + + + + 389 + + + + + 390 + + + + + 391 + + + + + 392 + + + + + 393 + + + + + 394 + + + + + 395 + + + + + 396 + + + + + 397 + + + + + + + + 398 + + + + + + + + 399 + + + + + + + + 400 + + + + + 401 + + + + + 402 + + + + + 403 + + + + + 404 + + + + + 405 + + + + + + + + + + + + 406 + + + + + 407 + + + + + 408 + + + + + 409 + + + + + 410 + + + + + 411 + + + + + + + + + + 412 + + + + + 413 + + + + + 414 + + + + + 415 + + + + + + + + + + + 416 + + + + + 417 + + + + + 418 + + + + + 419 + + + + + 420 + + + + + 450 + + + + + + + + 451 + + + + + + + + + + 452 + + + + + 453 + + + + + 454 + + + + + 457 + + + + + 459 + + + + + 460 + + + + + 462 + + + + + 465 + + + + + 466 + + + + + 485 + + + + + 490 + + + + + + + + 491 + + + + + + + + 492 + + + + + 494 + + + + + 496 + + + + + + + + 497 + + + + + + + + + + + + + + + + + 498 + + + + + 499 + + + + + 500 + + + + + 501 + + + + + 502 + + + + + 503 + + + + + + + + 504 + + + + + 505 + + + + + 506 + + + + + 507 + + + + + 508 + + + + + + + + + + + + + + + + 509 + + + + + 510 + + + + + 511 + + + + + 512 + + + + + 513 + + + + + 514 + + + + + 515 + + + + + 516 + + + + + 517 + + + + + 534 + + + + + 536 + + + + + + + + 537 + + + + + 540 + + + + + + + + 541 + + + + + 544 + + + + + + + + 545 + + + + + 554 + + + + + + + + 555 + + + + + 561 + + + + + + + + 563 + + + + + 566 + + + + + + + + 567 + + + + + 583 + + + + + + + + 584 + + + + + 591 + + + + + + + + 593 + + + + + 600 + + + + + + + + 601 + + + + + 609 + + + + + + + + 610 + + + + + 613 + + + + + + + + 614 + + + + + 627 + + + + + + + + + 634 + + + + + + + + 635 + + + + + 642 + + + + + + + + 643 + + + + + 651 + + + + + + + + 652 + + + + + 696 + + + + + + + + 697 + + + + + 701 + + + + + + + + 702 + + + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + {{380, 496}, {480, 360}} + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + 799 + + + + + AppDelegate + NSObject + + id + id + id + id + id + id + + + + changedDNA: + id + + + changedMutationRate: + id + + + changedPopulation: + id + + + loadGoalDNA: + id + + + pause: + id + + + startEvolution: + id + + + + NSButton + NSButton + NSButton + NSTextField + NSTextField + NSSliderCell + NSSlider + NSSlider + NSTextField + NSTextField + NSTextField + NSTextField + NSWindow + + + + btnLoadGoalDNA + NSButton + + + btnPause + NSButton + + + btnStartEvolution + NSButton + + + lblBestMatch + NSTextField + + + lblGeneration + NSTextField + + + sliderDNALength + NSSliderCell + + + sliderMutationRate + NSSlider + + + sliderPopulationSize + NSSlider + + + textDNALength + NSTextField + + + textGoalDNA + NSTextField + + + textMutationRate + NSTextField + + + textPopulationSize + NSTextField + + + window + NSWindow + + + + IBProjectSource + ./Classes/AppDelegate.h + + + + + 0 + IBCocoaFramework + YES + 3 + + {11, 11} + {10, 3} + + + diff --git a/iDNA/iDNA-Info.plist b/iDNA/iDNA-Info.plist new file mode 100644 index 0000000..e084761 --- /dev/null +++ b/iDNA/iDNA-Info.plist @@ -0,0 +1,34 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + rsevseev.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSMinimumSystemVersion + ${MACOSX_DEPLOYMENT_TARGET} + NSHumanReadableCopyright + Copyright © 2012 Роман Евсеев. All rights reserved. + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/iDNA/iDNA-Prefix.pch b/iDNA/iDNA-Prefix.pch new file mode 100644 index 0000000..24593cd --- /dev/null +++ b/iDNA/iDNA-Prefix.pch @@ -0,0 +1,7 @@ +// +// Prefix header for all source files of the 'iDNA' target in the 'iDNA' project +// + +#ifdef __OBJC__ + #import +#endif diff --git a/iDNA/main.m b/iDNA/main.m new file mode 100644 index 0000000..2c7f56f --- /dev/null +++ b/iDNA/main.m @@ -0,0 +1,14 @@ +// +// main.m +// iDNA +// +// Created by Роман Евсеев on 25.12.12. +// Copyright (c) 2012 Роман Евсеев. All rights reserved. +// + +#import + +int main(int argc, char *argv[]) +{ + return NSApplicationMain(argc, (const char **)argv); +}