NSAttributedString *astr = [[NSAttributedString alloc]initWithString:str];
NSTextStorage *storage = [mView textStorage];
[storage performSelectorOnMainThread:@selector(appendAttributedString:) withObject:astr waitUntilDone:NO];
- [mController performSelectorOnMainThread:@selector(showConsoleButtom) withObject:nil waitUntilDone:NO];
+ [mController performSelectorOnMainThread:@selector(showConsoleBottom) withObject:nil waitUntilDone:NO];
}
#ifdef DEBUG
NSLog(@"%@", str);
IBOutlet NSButton *uiStart;
IBOutlet NSButton *uiStop;
+
+ IBOutlet NSComboBox *uiSampleSelection;
void *signal1;
void *signal2;
SourceViewWindowController *sourceViewCell21;
SourceViewWindowController *sourceViewCell22;
SourceViewWindowController *sourceViewCell31;
-
+
+ int sampleSelection;
+
NSString *layer1code;
NSString *layer2code;
NSString *layer3code;
-(IBAction)cell22Action:(id)sender;
-(IBAction)cell31Action:(id)sender;
+-(IBAction)setupSampleCode:(id)sender;
+
//console
--(void) showConsoleButtom;
+-(void) showConsoleBottom;
//
- (void)windowWillClose:(NSNotification *)aNotification;
{
container = 0;
_isRunning = false;
+ sampleSelection = 1;
- NSString *layer1path = [[NSBundle mainBundle] pathForResource:@"layer1" ofType:@"js"];
- NSString *layer2path = [[NSBundle mainBundle] pathForResource:@"layer2" ofType:@"js"];
- NSString *layer3path = [[NSBundle mainBundle] pathForResource:@"layer3" ofType:@"js"];
-
- layer1code = [[NSString alloc]initWithContentsOfFile:layer1path
- encoding:NSUTF8StringEncoding
- error:NULL];
-
- layer2code = [[NSString alloc]initWithContentsOfFile:layer2path
- encoding:NSUTF8StringEncoding
- error:NULL];
-
- layer3code = [[NSString alloc]initWithContentsOfFile:layer3path
- encoding:NSUTF8StringEncoding
- error:NULL];
-
- startupScript11 = @"this.priorityReceptor = \"signal1\";";
- startupScript12 = @"this.priorityReceptor = \"signal2\";";
- startupScript13 = @"this.priorityReceptor = \"signal3\";";
- startupScript21 = @"this.priorityReceptor1 = \"Cell 1-1\";\nthis.priorityReceptor2 = \"Cell 1-2\";";
- startupScript22 = @"this.priorityReceptor1 = \"Cell 1-3\";\nthis.priorityReceptor2 = \"Cell 1-2\";";
- startupScript31 = @"this.priorityReceptor1 = \"Cell 2-1\";\nthis.priorityReceptor2 = \"Cell 2-2\";";
+ [self setupSampleCode:nil];
((ConsoleUIOut*)console)->setTextView(uiConsole);
}
return _isRunning;
}
--(void) showConsoleButtom
+-(void) showConsoleBottom
{
NSRange theEnd=NSMakeRange([[uiConsole string] length],0);
[uiConsole scrollRangeToVisible:theEnd];
[uiTFTickInterval setEditable:YES];
}
+-(IBAction)setupSampleCode:(id)sender
+{
+
+ if (sender != nil)
+ {
+ NSInteger sl = [sender indexOfSelectedItem];
+ if (sl >= 0.0)
+ {
+ sampleSelection = (int)sl + 1;
+ }
+
+ }
+ NSString *layer1_path;
+ NSString *layer2_path;
+ NSString *layer3_path;
+
+ NSString *startup11_path;
+ NSString *startup12_path;
+ NSString *startup13_path;
+ NSString *startup21_path;
+ NSString *startup22_path;
+ NSString *startup31_path;
+
+ switch(sampleSelection)
+ {
+ case 1:
+ layer1_path = [[NSBundle mainBundle] pathForResource:@"layer1_1" ofType:@"js"];
+ layer2_path = [[NSBundle mainBundle] pathForResource:@"layer2_1" ofType:@"js"];
+ layer3_path = [[NSBundle mainBundle] pathForResource:@"layer3_1" ofType:@"js"];
+ startup11_path = [[NSBundle mainBundle] pathForResource:@"startup11_1" ofType:@"js"];
+ startup12_path = [[NSBundle mainBundle] pathForResource:@"startup12_1" ofType:@"js"];
+ startup13_path = [[NSBundle mainBundle] pathForResource:@"startup13_1" ofType:@"js"];
+ startup21_path = [[NSBundle mainBundle] pathForResource:@"startup21_1" ofType:@"js"];
+ startup22_path = [[NSBundle mainBundle] pathForResource:@"startup22_1" ofType:@"js"];
+ startup31_path = [[NSBundle mainBundle] pathForResource:@"startup31_1" ofType:@"js"];
+ break;
+ case 2:
+ layer1_path = [[NSBundle mainBundle] pathForResource:@"layer1_2" ofType:@"js"];
+ layer2_path = [[NSBundle mainBundle] pathForResource:@"layer2_2" ofType:@"js"];
+ layer3_path = [[NSBundle mainBundle] pathForResource:@"layer3_2" ofType:@"js"];
+ startup11_path = [[NSBundle mainBundle] pathForResource:@"startup11_2" ofType:@"js"];
+ startup12_path = [[NSBundle mainBundle] pathForResource:@"startup12_2" ofType:@"js"];
+ startup13_path = [[NSBundle mainBundle] pathForResource:@"startup13_2" ofType:@"js"];
+ startup21_path = [[NSBundle mainBundle] pathForResource:@"startup21_2" ofType:@"js"];
+ startup22_path = [[NSBundle mainBundle] pathForResource:@"startup22_2" ofType:@"js"];
+ startup31_path = [[NSBundle mainBundle] pathForResource:@"startup31_2" ofType:@"js"];
+ break;
+ }
+
+ layer1code = [[NSString alloc]initWithContentsOfFile:layer1_path encoding:NSUTF8StringEncoding error:NULL];
+ layer2code = [[NSString alloc]initWithContentsOfFile:layer2_path encoding:NSUTF8StringEncoding error:NULL];
+ layer3code = [[NSString alloc]initWithContentsOfFile:layer3_path encoding:NSUTF8StringEncoding error:NULL];
+ startupScript11 = [[NSString alloc]initWithContentsOfFile:startup11_path encoding:NSUTF8StringEncoding error:NULL];
+ startupScript12 = [[NSString alloc]initWithContentsOfFile:startup12_path encoding:NSUTF8StringEncoding error:NULL];
+ startupScript13 = [[NSString alloc]initWithContentsOfFile:startup13_path encoding:NSUTF8StringEncoding error:NULL];
+ startupScript21 = [[NSString alloc]initWithContentsOfFile:startup21_path encoding:NSUTF8StringEncoding error:NULL];
+ startupScript22 = [[NSString alloc]initWithContentsOfFile:startup22_path encoding:NSUTF8StringEncoding error:NULL];
+ startupScript31 = [[NSString alloc]initWithContentsOfFile:startup31_path encoding:NSUTF8StringEncoding error:NULL];
+
+ [self updateCodeInSourceCodeView];
+ [self stopAction:nil];
+}
+
+
-(void)setupContainer
{
TKJSContainer *ctn = new TKJSContainer();
<string key="NS.object.0">1938</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
+ <string>NSComboBoxCell</string>
<string>NSScroller</string>
<string>NSMenuItem</string>
<string>NSMenu</string>
<string>NSButton</string>
<string>NSBox</string>
<string>NSButtonCell</string>
+ <string>NSComboBox</string>
<string>NSSlider</string>
<string>NSSliderCell</string>
<string>NSCustomObject</string>
<string key="NSFrame">{{585, 27}, {101, 22}}</string>
<reference key="NSSuperview" ref="774642338"/>
<reference key="NSWindow"/>
- <reference key="NSNextKeyView" ref="512215918"/>
+ <reference key="NSNextKeyView" ref="627968623"/>
<string key="NSReuseIdentifierKey">_NS:903</string>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="742561084">
<reference key="NSSupport" ref="522812030"/>
<string key="NSCellIdentifier">_NS:687</string>
<reference key="NSControlView" ref="436897875"/>
- <int key="NSButtonFlags">914505983</int>
+ <int key="NSButtonFlags">-1232977665</int>
<int key="NSButtonFlags2">129</int>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSTitlePosition">2</int>
<bool key="NSTransparent">NO</bool>
</object>
+ <object class="NSComboBox" id="627968623">
+ <reference key="NSNextResponder" ref="398570593"/>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrame">{{342, 570}, {204, 26}}</string>
+ <reference key="NSSuperview" ref="398570593"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="512215918"/>
+ <string key="NSReuseIdentifierKey">_NS:708</string>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSComboBoxCell" key="NSCell" id="410833679">
+ <int key="NSCellFlags">343014976</int>
+ <int key="NSCellFlags2">272630784</int>
+ <string key="NSContents">signal transfar</string>
+ <reference key="NSSupport" ref="522812030"/>
+ <string key="NSCellIdentifier">_NS:708</string>
+ <reference key="NSControlView" ref="627968623"/>
+ <bool key="NSDrawsBackground">YES</bool>
+ <reference key="NSBackgroundColor" ref="620781560"/>
+ <reference key="NSTextColor" ref="909197348"/>
+ <int key="NSVisibleItemCount">5</int>
+ <bool key="NSHasVerticalScroller">YES</bool>
+ <array class="NSMutableArray" key="NSPopUpListData">
+ <string>signal transfar</string>
+ <string>The learning cell</string>
+ </array>
+ <reference key="NSDelegate" ref="627968623"/>
+ <object class="NSComboTableView" key="NSTableView" id="189491886">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">274</int>
+ <string key="NSFrameSize">{13, 42}</string>
+ <reference key="NSSuperview"/>
+ <reference key="NSWindow"/>
+ <string key="NSReuseIdentifierKey">_NS:738</string>
+ <bool key="NSEnabled">YES</bool>
+ <array class="NSMutableArray" key="NSTableColumns">
+ <object class="NSTableColumn">
+ <double key="NSWidth">10</double>
+ <double key="NSMinWidth">10</double>
+ <double key="NSMaxWidth">1000</double>
+ <object class="NSTableHeaderCell" key="NSHeaderCell">
+ <int key="NSCellFlags">75628032</int>
+ <int key="NSCellFlags2">0</int>
+ <string key="NSContents"/>
+ <object class="NSFont" key="NSSupport">
+ <string key="NSName">LucidaGrande</string>
+ <double key="NSSize">12</double>
+ <int key="NSfFlags">16</int>
+ </object>
+ <object class="NSColor" key="NSBackgroundColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MC4zMzMzMzI5ODU2AA</bytes>
+ </object>
+ <reference key="NSTextColor" ref="247752926"/>
+ </object>
+ <object class="NSTextFieldCell" key="NSDataCell">
+ <int key="NSCellFlags">338820672</int>
+ <int key="NSCellFlags2">1024</int>
+ <reference key="NSSupport" ref="522812030"/>
+ <reference key="NSControlView" ref="189491886"/>
+ <bool key="NSDrawsBackground">YES</bool>
+ <object class="NSColor" key="NSBackgroundColor" id="517725496">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">controlBackgroundColor</string>
+ <reference key="NSColor" ref="112775318"/>
+ </object>
+ <reference key="NSTextColor" ref="909197348"/>
+ </object>
+ <int key="NSResizingMask">3</int>
+ <bool key="NSIsResizeable">YES</bool>
+ <reference key="NSTableView" ref="189491886"/>
+ </object>
+ </array>
+ <double key="NSIntercellSpacingWidth">3</double>
+ <double key="NSIntercellSpacingHeight">2</double>
+ <reference key="NSBackgroundColor" ref="517725496"/>
+ <object class="NSColor" key="NSGridColor">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">gridColor</string>
+ <object class="NSColor" key="NSColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MC41AA</bytes>
+ </object>
+ </object>
+ <double key="NSRowHeight">19</double>
+ <string key="NSAction">tableViewAction:</string>
+ <int key="NSTvFlags">-765427712</int>
+ <reference key="NSDelegate" ref="410833679"/>
+ <reference key="NSDataSource" ref="410833679"/>
+ <reference key="NSTarget" ref="410833679"/>
+ <int key="NSColumnAutoresizingStyle">1</int>
+ <int key="NSDraggingSourceMaskForLocal">15</int>
+ <int key="NSDraggingSourceMaskForNonLocal">0</int>
+ <bool key="NSAllowsTypeSelect">YES</bool>
+ <int key="NSTableViewDraggingDestinationStyle">0</int>
+ <int key="NSTableViewGroupRowStyle">1</int>
+ </object>
+ </object>
+ </object>
+ <object class="NSTextField" id="336004276">
+ <reference key="NSNextResponder" ref="398570593"/>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrame">{{255, 576}, {71, 17}}</string>
+ <reference key="NSSuperview" ref="398570593"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="714063894"/>
+ <string key="NSReuseIdentifierKey">_NS:3944</string>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="554744950">
+ <int key="NSCellFlags">68288064</int>
+ <int key="NSCellFlags2">272630784</int>
+ <string key="NSContents">Cell code :</string>
+ <reference key="NSSupport" ref="522812030"/>
+ <string key="NSCellIdentifier">_NS:3944</string>
+ <reference key="NSControlView" ref="336004276"/>
+ <reference key="NSBackgroundColor" ref="872457813"/>
+ <reference key="NSTextColor" ref="909197348"/>
+ </object>
+ </object>
+ <object class="NSButton" id="426392027">
+ <reference key="NSNextResponder" ref="398570593"/>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrame">{{562, 569}, {25, 25}}</string>
+ <reference key="NSSuperview" ref="398570593"/>
+ <reference key="NSWindow"/>
+ <string key="NSReuseIdentifierKey">_NS:3976</string>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="973501395">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">134217728</int>
+ <string key="NSContents"/>
+ <reference key="NSSupport" ref="522812030"/>
+ <string key="NSCellIdentifier">_NS:3976</string>
+ <reference key="NSControlView" ref="426392027"/>
+ <int key="NSButtonFlags">-2038415105</int>
+ <int key="NSButtonFlags2">161</int>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
</array>
<string key="NSFrameSize">{800, 600}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
- <reference key="NSNextKeyView" ref="714063894"/>
+ <reference key="NSNextKeyView" ref="336004276"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
<string key="NSMinSize">{800, 622}</string>
</object>
<int key="connectionID">732</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">uiSampleSelection</string>
+ <reference key="source" ref="292133641"/>
+ <reference key="destination" ref="627968623"/>
+ </object>
+ <int key="connectionID">739</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">setupSampleCode:</string>
+ <reference key="source" ref="292133641"/>
+ <reference key="destination" ref="627968623"/>
+ </object>
+ <int key="connectionID">740</int>
+ </object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
<reference ref="512215918"/>
<reference ref="829500719"/>
<reference ref="960255540"/>
+ <reference ref="627968623"/>
+ <reference ref="336004276"/>
+ <reference ref="426392027"/>
</array>
<reference key="parent" ref="714731955"/>
</object>
<reference key="object" ref="556494046"/>
<reference key="parent" ref="411008750"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">733</int>
+ <reference key="object" ref="627968623"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="410833679"/>
+ </array>
+ <reference key="parent" ref="398570593"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">734</int>
+ <reference key="object" ref="410833679"/>
+ <reference key="parent" ref="627968623"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">735</int>
+ <reference key="object" ref="336004276"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="554744950"/>
+ </array>
+ <reference key="parent" ref="398570593"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">736</int>
+ <reference key="object" ref="554744950"/>
+ <reference key="parent" ref="336004276"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">737</int>
+ <reference key="object" ref="426392027"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="973501395"/>
+ </array>
+ <reference key="parent" ref="398570593"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">738</int>
+ <reference key="object" ref="973501395"/>
+ <reference key="parent" ref="426392027"/>
+ </object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
<string key="704.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="72.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="73.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="733.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <array key="734.IBComboBoxObjectValuesKey.objectValues">
+ <string>signal transfar</string>
+ <string>The learning cell</string>
+ </array>
+ <string key="734.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="735.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="736.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="737.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="738.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="74.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="75.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="77.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
- <int key="maxID">732</int>
+ <int key="maxID">740</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<string key="cell21Action:">id</string>
<string key="cell22Action:">id</string>
<string key="cell31Action:">id</string>
+ <string key="setupSampleCode:">id</string>
<string key="startAction:">id</string>
<string key="stopAction:">id</string>
</dictionary>
<string key="name">cell31Action:</string>
<string key="candidateClassName">id</string>
</object>
+ <object class="IBActionInfo" key="setupSampleCode:">
+ <string key="name">setupSampleCode:</string>
+ <string key="candidateClassName">id</string>
+ </object>
<object class="IBActionInfo" key="startAction:">
<string key="name">startAction:</string>
<string key="candidateClassName">id</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="uiConsole">NSTextView</string>
+ <string key="uiSampleSelection">NSComboBox</string>
<string key="uiSignal1">NSButton</string>
<string key="uiSignal2">NSButton</string>
<string key="uiSignal3">NSButton</string>
<string key="name">uiConsole</string>
<string key="candidateClassName">NSTextView</string>
</object>
+ <object class="IBToOneOutletInfo" key="uiSampleSelection">
+ <string key="name">uiSampleSelection</string>
+ <string key="candidateClassName">NSComboBox</string>
+ </object>
<object class="IBToOneOutletInfo" key="uiSignal1">
<string key="name">uiSignal1</string>
<string key="candidateClassName">NSButton</string>
--- /dev/null
+
+function doTick(time)
+{
+ print(this.cell.name + " -> doTick: " + this.priorityReceptor + ":" + this.cell.receptors[this.priorityReceptor] + "\n");
+ this.cell.axonValue = this.cell.receptors[this.priorityReceptor];
+}
+
+function doInit()
+{
+ print(this.cell.name + " -> doInit()\n");
+ print(this.cell.name + " priotiry receptor:" + this.priorityReceptor + "\n" );
+}
--- /dev/null
+
+
+function doTick(time)
+{
+ switch(this.logic)
+ {
+ case 1:
+ case 2:
+ var dt = (time - this.pt) / 3.0;
+ this.pt = time;
+
+ var ds1 = Math.abs(this.sav1 - this.cell.receptors["signal1"]);
+ var ds2 = Math.abs(this.sav2 - this.cell.receptors["signal2"]);
+ var ds3 = Math.abs(this.sav3 - this.cell.receptors["signal3"]);
+
+ var s = 0;
+ if (ds1 + ds2 + ds3 > 0.1) {
+ if (ds1 < ds2) {
+ if (ds2 < ds3)
+ {
+ if (this.logic == 1)
+ s = 3;
+ else
+ s = this.cell.receptors["signal3"] - this.sav3;
+ }
+ else
+ {
+ if (this.logic == 1)
+ s = 2;
+ else
+ s = this.cell.receptors["signal2"] - this.sav2;
+ }
+ }
+ else
+ {
+ if (ds1 < ds3)
+ {
+ if (this.logic == 1)
+ s = 3;
+ else
+ s = this.cell.receptors["signal3"] - this.sav3;
+ }
+ else
+ {
+ if (this.logic == 1)
+ s = 1;
+ else
+ s = this.cell.receptors["signal1"] - this.sav1;
+ }
+ }
+ }
+
+ this.cell.axonValue = s;
+
+ this.sav1 = this.sav1 * (1 - dt) + this.cell.receptors["signal1"] * dt;
+ this.sav2 = this.sav2 * (1 - dt) + this.cell.receptors["signal2"] * dt;
+ this.sav3 = this.sav3 * (1 - dt) + this.cell.receptors["signal3"] * dt;
+
+ break;
+ }
+}
+
+function doInit()
+{
+ print(this.cell.name + " -> doInit()\n");
+ print(this.cell.name + " priotiry receptor:" + this.priorityReceptor + "\n" );
+}
+
--- /dev/null
+function doTick(time)
+{
+ this.cell.axonValue = this.cell.receptors[this.priorityReceptor1] * 0.6 + this.cell.receptors[this.priorityReceptor2] * 0.4;
+}
+
+function doInit()
+{
+ print(this.cell.name + " -> doInit() \n");
+ print(this.cell.name + " : priority1:" + this.priorityReceptor1 + "\n");
+ print(this.cell.name + " : priority2:" + this.priorityReceptor2 + "\n");
+}
--- /dev/null
+
+function doTick(time)
+{
+ if (this.active)
+ {
+ var dt = (time - this.pt) / 3.0;
+ this.pt = time;
+
+ var gp = global.property1;
+ if (this.globalP1avg == undefined)
+ {
+ this.globalP1avg = gp;
+ }
+
+ this.globalP1avg = this.globalP1avg * (1 - dt) + gp * dt;
+
+ var dg = Math.abs(this.globalP1avg - gp);
+
+ var as = Math.floor(this.cell.receptors["Cell 1-1"]); // active signal
+
+ if (dg > 0.1 && this.cell.receptors["Cell 1-2"] > 0 )
+ {
+ //global property is moving
+ this.patterns[as] = gp;
+ this.cell.axonValue = gp;
+ }
+ else
+ {
+ if (as > 0)
+ this.cell.axonValue = this.patterns[as];
+ }
+ }
+}
+
+function doInit()
+{
+ print(this.cell.name + " -> doInit() \n");
+}
--- /dev/null
+function doTick(time)
+{
+ var v = (this.cell.receptors[this.priorityReceptor1] * 0.6 + this.cell.receptors[this.priorityReceptor2] * 0.4) * global.property1;
+
+ if (v < this.minValue)
+ {
+ print(this.cell.name + " calculated axon value is under min value. set to " + this.minValue);
+ v = this.minValue;
+ }
+ else if (v > this.maxValue)
+ {
+ print(this.cell.name + " calculated axon value is over max value. set to " + this.maxValue);
+ v = this.maxValue;
+ }
+
+ this.cell.axonValue = v;
+}
+
+function doInit()
+{
+ print(this.cell.name + " -> doInit()\n");
+ print(this.cell.name + " : priority1:" + this.priorityReceptor1 +"\n");
+ print(this.cell.name + " : priority2:" + this.priorityReceptor2 +"\n");
+}
+
+var maxValue = 1.0;
+var minValue = 0.0;
--- /dev/null
+
+function doTick(time)
+{
+
+ this.cell.axonValue = this.cell.receptors["Cell 2-1"] / 2.0;
+}
+
+function doInit()
+{
+ print(this.cell.name + " -> doInit()\n");
+}
--- /dev/null
+
+this.priorityReceptor = "signal1";
--- /dev/null
+
+this.sav1 = 0.0;
+this.sav2 = 0.0;
+this.sav3 = 0.0;
+this.pt = 0.0;
+
+this.logic = 1; // find most recent change
--- /dev/null
+
+
+this.priorityReceptor = "signal2";
--- /dev/null
+
+
+this.sav1 = 0.0;
+this.sav2 = 0.0;
+this.sav3 = 0.0;
+this.pt = 0.0;
+
+this.logic = 2; // find most recent change and return delta
--- /dev/null
+
+this.priorityReceptor = "signal3";
--- /dev/null
+
+this.priorityReceptor1 = "Cell 1-1";
+this.priorityReceptor2 = "Cell 1-2";
--- /dev/null
+this.patterns = [0,0,0,0];
+this.active = true;
+
+this.globalP1avg = undefined;
+this.pt = 0.0;
--- /dev/null
+this.priorityReceptor1 = "Cell 1-3";
+this.priorityReceptor2 = "Cell 1-2";
--- /dev/null
+
+this.priorityReceptor1 = "Cell 2-1";
+this.priorityReceptor2 = "Cell 2-2";
7F0C584B14B1522700C1FF4D /* TKLog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F0C584A14B1522700C1FF4D /* TKLog.cpp */; };
7F0C584E14B157DC00C1FF4D /* TKLog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F0C584A14B1522700C1FF4D /* TKLog.cpp */; };
7F0C585014B15A5200C1FF4D /* ConsoleUIOut.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7F0C584F14B15A5200C1FF4D /* ConsoleUIOut.mm */; };
- 7F2FBB9114AC9D9B004F8FBE /* layer1.js in Resources */ = {isa = PBXBuildFile; fileRef = 7F2FBB8A14AC9CB0004F8FBE /* layer1.js */; };
- 7F2FBB9214AC9D9B004F8FBE /* layer2.js in Resources */ = {isa = PBXBuildFile; fileRef = 7F2FBB8C14AC9D31004F8FBE /* layer2.js */; };
- 7F2FBB9314AC9D9B004F8FBE /* layer3.js in Resources */ = {isa = PBXBuildFile; fileRef = 7F2FBB8E14AC9D3A004F8FBE /* layer3.js */; };
+ 7F0E776B14B4621600AFE3A5 /* layer2_2.js in Resources */ = {isa = PBXBuildFile; fileRef = 7F0E776A14B4621600AFE3A5 /* layer2_2.js */; };
+ 7F0E776D14B4622E00AFE3A5 /* layer3_2.js in Resources */ = {isa = PBXBuildFile; fileRef = 7F0E776C14B4622E00AFE3A5 /* layer3_2.js */; };
+ 7F0E778614B48A3200AFE3A5 /* startup11_1.js in Resources */ = {isa = PBXBuildFile; fileRef = 7F0E776E14B4629D00AFE3A5 /* startup11_1.js */; };
+ 7F0E778714B48A3200AFE3A5 /* startup12_1.js in Resources */ = {isa = PBXBuildFile; fileRef = 7F0E777014B4635200AFE3A5 /* startup12_1.js */; };
+ 7F0E778814B48A3200AFE3A5 /* startup13_1.js in Resources */ = {isa = PBXBuildFile; fileRef = 7F0E777214B4636800AFE3A5 /* startup13_1.js */; };
+ 7F0E778914B48A3200AFE3A5 /* startup21_1.js in Resources */ = {isa = PBXBuildFile; fileRef = 7F0E777414B4639B00AFE3A5 /* startup21_1.js */; };
+ 7F0E778A14B48A3200AFE3A5 /* startup22_1.js in Resources */ = {isa = PBXBuildFile; fileRef = 7F0E777614B463AF00AFE3A5 /* startup22_1.js */; };
+ 7F0E778B14B48A3200AFE3A5 /* startup31_1.js in Resources */ = {isa = PBXBuildFile; fileRef = 7F0E777814B4744400AFE3A5 /* startup31_1.js */; };
+ 7F0E778C14B48A3200AFE3A5 /* startup11_2.js in Resources */ = {isa = PBXBuildFile; fileRef = 7F0E777A14B4745F00AFE3A5 /* startup11_2.js */; };
+ 7F0E778D14B48A3200AFE3A5 /* startup12_2.js in Resources */ = {isa = PBXBuildFile; fileRef = 7F0E777C14B4747200AFE3A5 /* startup12_2.js */; };
+ 7F0E778E14B48A3200AFE3A5 /* startup13_2.js in Resources */ = {isa = PBXBuildFile; fileRef = 7F0E777E14B4747D00AFE3A5 /* startup13_2.js */; };
+ 7F0E778F14B48A3200AFE3A5 /* startup21_2.js in Resources */ = {isa = PBXBuildFile; fileRef = 7F0E778014B4748800AFE3A5 /* startup21_2.js */; };
+ 7F0E779014B48A3200AFE3A5 /* startup22_2.js in Resources */ = {isa = PBXBuildFile; fileRef = 7F0E778214B4749E00AFE3A5 /* startup22_2.js */; };
+ 7F0E779114B48A3200AFE3A5 /* startup31_2.js in Resources */ = {isa = PBXBuildFile; fileRef = 7F0E778414B474AA00AFE3A5 /* startup31_2.js */; };
+ 7F0E779214B48A5A00AFE3A5 /* layer1_2.js in Resources */ = {isa = PBXBuildFile; fileRef = 7F0E776714B461F000AFE3A5 /* layer1_2.js */; };
+ 7F2FBB9114AC9D9B004F8FBE /* layer1_1.js in Resources */ = {isa = PBXBuildFile; fileRef = 7F2FBB8A14AC9CB0004F8FBE /* layer1_1.js */; };
+ 7F2FBB9214AC9D9B004F8FBE /* layer2_1.js in Resources */ = {isa = PBXBuildFile; fileRef = 7F2FBB8C14AC9D31004F8FBE /* layer2_1.js */; };
+ 7F2FBB9314AC9D9B004F8FBE /* layer3_1.js in Resources */ = {isa = PBXBuildFile; fileRef = 7F2FBB8E14AC9D3A004F8FBE /* layer3_1.js */; };
7F4C432414AE26730098694B /* SourceViewWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7F4C432314AE26730098694B /* SourceViewWindow.xib */; };
7FDCE1C814ACBB68002E3FBF /* TKUICell.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7FDCE1C714ACBB68002E3FBF /* TKUICell.cpp */; };
7FEF016214A879EA00051DED /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7FEF016114A879EA00051DED /* Cocoa.framework */; };
7F0C584D14B1554E00C1FF4D /* TKConsole.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TKConsole.h; sourceTree = "<group>"; };
7F0C584F14B15A5200C1FF4D /* ConsoleUIOut.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ConsoleUIOut.mm; sourceTree = "<group>"; };
7F0C585114B15AC100C1FF4D /* ConsoleUIOut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConsoleUIOut.h; sourceTree = "<group>"; };
- 7F2FBB8A14AC9CB0004F8FBE /* layer1.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = layer1.js; sourceTree = "<group>"; };
- 7F2FBB8C14AC9D31004F8FBE /* layer2.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = layer2.js; sourceTree = "<group>"; };
- 7F2FBB8E14AC9D3A004F8FBE /* layer3.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = layer3.js; sourceTree = "<group>"; };
+ 7F0E776714B461F000AFE3A5 /* layer1_2.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = layer1_2.js; sourceTree = "<group>"; };
+ 7F0E776A14B4621600AFE3A5 /* layer2_2.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = layer2_2.js; sourceTree = "<group>"; };
+ 7F0E776C14B4622E00AFE3A5 /* layer3_2.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = layer3_2.js; sourceTree = "<group>"; };
+ 7F0E776E14B4629D00AFE3A5 /* startup11_1.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = startup11_1.js; sourceTree = "<group>"; };
+ 7F0E777014B4635200AFE3A5 /* startup12_1.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = startup12_1.js; sourceTree = "<group>"; };
+ 7F0E777214B4636800AFE3A5 /* startup13_1.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = startup13_1.js; sourceTree = "<group>"; };
+ 7F0E777414B4639B00AFE3A5 /* startup21_1.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = startup21_1.js; sourceTree = "<group>"; };
+ 7F0E777614B463AF00AFE3A5 /* startup22_1.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = startup22_1.js; sourceTree = "<group>"; };
+ 7F0E777814B4744400AFE3A5 /* startup31_1.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = startup31_1.js; sourceTree = "<group>"; };
+ 7F0E777A14B4745F00AFE3A5 /* startup11_2.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = startup11_2.js; sourceTree = "<group>"; };
+ 7F0E777C14B4747200AFE3A5 /* startup12_2.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = startup12_2.js; sourceTree = "<group>"; };
+ 7F0E777E14B4747D00AFE3A5 /* startup13_2.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = startup13_2.js; sourceTree = "<group>"; };
+ 7F0E778014B4748800AFE3A5 /* startup21_2.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = startup21_2.js; sourceTree = "<group>"; };
+ 7F0E778214B4749E00AFE3A5 /* startup22_2.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = startup22_2.js; sourceTree = "<group>"; };
+ 7F0E778414B474AA00AFE3A5 /* startup31_2.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = startup31_2.js; sourceTree = "<group>"; };
+ 7F2FBB8A14AC9CB0004F8FBE /* layer1_1.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = layer1_1.js; sourceTree = "<group>"; };
+ 7F2FBB8C14AC9D31004F8FBE /* layer2_1.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = layer2_1.js; sourceTree = "<group>"; };
+ 7F2FBB8E14AC9D3A004F8FBE /* layer3_1.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = layer3_1.js; sourceTree = "<group>"; };
7F4C432314AE26730098694B /* SourceViewWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SourceViewWindow.xib; sourceTree = "<group>"; };
7FDCE1C514ACBB53002E3FBF /* TKUICell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TKUICell.h; sourceTree = "<group>"; };
7FDCE1C714ACBB68002E3FBF /* TKUICell.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TKUICell.cpp; sourceTree = "<group>"; };
7F0C585114B15AC100C1FF4D /* ConsoleUIOut.h */,
7F0C584F14B15A5200C1FF4D /* ConsoleUIOut.mm */,
7FEF023B14A8CFA300051DED /* Supporting Files */,
- 7F2FBB8A14AC9CB0004F8FBE /* layer1.js */,
- 7F2FBB8C14AC9D31004F8FBE /* layer2.js */,
- 7F2FBB8E14AC9D3A004F8FBE /* layer3.js */,
+ 7F2FBB8A14AC9CB0004F8FBE /* layer1_1.js */,
+ 7F2FBB8C14AC9D31004F8FBE /* layer2_1.js */,
+ 7F2FBB8E14AC9D3A004F8FBE /* layer3_1.js */,
+ 7F0E776714B461F000AFE3A5 /* layer1_2.js */,
+ 7F0E776A14B4621600AFE3A5 /* layer2_2.js */,
+ 7F0E776C14B4622E00AFE3A5 /* layer3_2.js */,
+ 7F0E776E14B4629D00AFE3A5 /* startup11_1.js */,
+ 7F0E777014B4635200AFE3A5 /* startup12_1.js */,
+ 7F0E777214B4636800AFE3A5 /* startup13_1.js */,
+ 7F0E777414B4639B00AFE3A5 /* startup21_1.js */,
+ 7F0E777614B463AF00AFE3A5 /* startup22_1.js */,
+ 7F0E777814B4744400AFE3A5 /* startup31_1.js */,
+ 7F0E777A14B4745F00AFE3A5 /* startup11_2.js */,
+ 7F0E777C14B4747200AFE3A5 /* startup12_2.js */,
+ 7F0E777E14B4747D00AFE3A5 /* startup13_2.js */,
+ 7F0E778014B4748800AFE3A5 /* startup21_2.js */,
+ 7F0E778214B4749E00AFE3A5 /* startup22_2.js */,
+ 7F0E778414B474AA00AFE3A5 /* startup31_2.js */,
);
path = "dennco-jstestapp1";
sourceTree = "<group>";
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- 7F2FBB9114AC9D9B004F8FBE /* layer1.js in Resources */,
- 7F2FBB9214AC9D9B004F8FBE /* layer2.js in Resources */,
- 7F2FBB9314AC9D9B004F8FBE /* layer3.js in Resources */,
+ 7F0E778614B48A3200AFE3A5 /* startup11_1.js in Resources */,
+ 7F0E778714B48A3200AFE3A5 /* startup12_1.js in Resources */,
+ 7F0E778814B48A3200AFE3A5 /* startup13_1.js in Resources */,
+ 7F0E778914B48A3200AFE3A5 /* startup21_1.js in Resources */,
+ 7F0E778A14B48A3200AFE3A5 /* startup22_1.js in Resources */,
+ 7F0E778B14B48A3200AFE3A5 /* startup31_1.js in Resources */,
+ 7F0E778C14B48A3200AFE3A5 /* startup11_2.js in Resources */,
+ 7F0E778D14B48A3200AFE3A5 /* startup12_2.js in Resources */,
+ 7F0E778E14B48A3200AFE3A5 /* startup13_2.js in Resources */,
+ 7F0E778F14B48A3200AFE3A5 /* startup21_2.js in Resources */,
+ 7F0E779014B48A3200AFE3A5 /* startup22_2.js in Resources */,
+ 7F0E779114B48A3200AFE3A5 /* startup31_2.js in Resources */,
+ 7F2FBB9114AC9D9B004F8FBE /* layer1_1.js in Resources */,
+ 7F2FBB9214AC9D9B004F8FBE /* layer2_1.js in Resources */,
+ 7F2FBB9314AC9D9B004F8FBE /* layer3_1.js in Resources */,
+ 7F0E779214B48A5A00AFE3A5 /* layer1_2.js in Resources */,
+ 7F0E776B14B4621600AFE3A5 /* layer2_2.js in Resources */,
+ 7F0E776D14B4622E00AFE3A5 /* layer3_2.js in Resources */,
7FEF023F14A8CFA300051DED /* InfoPlist.strings in Resources */,
7FEF024514A8CFA300051DED /* Credits.rtf in Resources */,
7FEF024B14A8CFA300051DED /* MainMenu.xib in Resources */,