Skip to content
This repository has been archived by the owner on Feb 2, 2022. It is now read-only.

iDNA final #42

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added iDNA/.DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions iDNA/goal_DNA.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CCTGGGATTAGGGTATCCGCCCTCTGTGACTCTTGG
351 changes: 351 additions & 0 deletions iDNA/iDNA.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "1"
version = "1.0">
</Bucket>
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0450"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "272A0BB01688485E00F6EFE7"
BuildableName = "iDNA.app"
BlueprintName = "iDNA"
ReferencedContainer = "container:iDNA.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "272A0BB01688485E00F6EFE7"
BuildableName = "iDNA.app"
BlueprintName = "iDNA"
ReferencedContainer = "container:iDNA.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "272A0BB01688485E00F6EFE7"
BuildableName = "iDNA.app"
BlueprintName = "iDNA"
ReferencedContainer = "container:iDNA.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "272A0BB01688485E00F6EFE7"
BuildableName = "iDNA.app"
BlueprintName = "iDNA"
ReferencedContainer = "container:iDNA.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>iDNA.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>272A0BB01688485E00F6EFE7</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
59 changes: 59 additions & 0 deletions iDNA/iDNA/AppDelegate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
//
// AppDelegate.h
// iDNA
//
// Created by Alexander Shvets on 24.12.12.
// Copyright (c) 2012 Alexander Shvets. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import "Cell.h"
#import "Population.h"

@interface AppDelegate : NSObject <NSApplicationDelegate>
{
int populationSize;
int DNALength;
int mutationRate;

int generation;
int bestMatch;

int appState;

Cell* goalDNA;
Population* population;
}

@property (assign) IBOutlet NSWindow *window;
@property (weak) IBOutlet NSTextField *fieldPopulationSize;
@property (weak) IBOutlet NSTextField *fieldDNALength;
@property (weak) IBOutlet NSTextField *fieldMutationRate;

@property (weak) IBOutlet NSSlider *sliderPopulationSize;
@property (weak) IBOutlet NSSlider *sliderDNALength;
@property (weak) IBOutlet NSSlider *sliderMutationRate;

@property (weak) IBOutlet NSTextField *fieldGoalDNA;
@property (weak) IBOutlet NSTextField *labelGeneration;
@property (weak) IBOutlet NSTextField *labelBestMatch;
@property (weak) IBOutlet NSLevelIndicator *progressMatch;

@property (weak) IBOutlet NSButton *btnStart;
@property (weak) IBOutlet NSButton *btnPause;
@property (weak) IBOutlet NSButton *btnLoad;

- (IBAction)startEvolution:(id)sender;
- (IBAction)pauseEvolution:(id)sender;
- (IBAction)loadGoalDNA:(id)sender;
- (NSString*)validateDNAString:(NSString*)DNAString;

- (void)buildGoalDNAWithLength:(int)length;

- (void)disableControls;
- (void)enableControls;
- (void)appReset;

- (void)evolution;

@end
Loading