<div dir="ltr"><div><div><div><div><div><div>Hello,<br><br></div>I completely forgot about this problem.<br><br>Here are some more files that will hopefully get rid of some of the confusion:<br></div>records.hrl:<br><a href="http://textsnip.com/a148rx">http://textsnip.com/a148rx</a><br>
</div>polis.erl:<br><a href="http://textsnip.com/bk8xao">http://textsnip.com/bk8xao</a><br></div>morphology.erl:<br><a href="http://textsnip.com/8rlag9">http://textsnip.com/8rlag9</a><br></div>genotype.erl:<br><a href="http://textsnip.com/ax1n49">http://textsnip.com/ax1n49</a><br>
<br></div><div>Let me know if there's anything else that I can hopefully shed light on.<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Aug 17, 2014 at 9:59 PM, Gustavo Pires <span dir="ltr"><<a href="mailto:devgutt@gmail.com" target="_blank">devgutt@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Where's the code of construct_Agent(Specie_Id, Agent_Id, SpecCon)? You only sent <span style="color:rgb(153,0,0);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;font-weight:bold;line-height:16.799999237060547px;white-space:pre-wrap">construct_Cortex. </span>Probably the problem is there.</div>
<div class="HOEnZb"><div class="h5">
<div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Aug 17, 2014 at 1:31 PM, Steve Strong <span dir="ltr"><<a href="mailto:steve@srstrong.com" target="_blank">steve@srstrong.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

                <div>
                    The record will be initialised with the defaults as specified in the hrl.  The code and stacktrace in the gist still suggest that SpecCon#constraint.morphology is ‘undefined’ - so something between the record construction below and the crash within the gist must be modifying the record.
                </div><span><font color="#888888">
                <div><div><br></div><div>-- </div><div>Steve Strong</div><div>Sent with <a href="http://www.sparrowmailapp.com/?sig" target="_blank">Sparrow</a></div><div><br></div></div></font></span><div>
<div>
                 
                <p style="color:#a0a0a8">On Sunday, 17 August 2014 at 15:36, Yves S. Garret wrote:</p>
                <blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px">
                    <span><div><div><div dir="ltr"><div>The record in question is "constraint".  The thing is, when I call it, it looks like this with none of the values initialized:<br><br>test() -><br>  Specie_Id = test,<br>

  Agent_Id = test,<br>
  CloneAgent_Id = test_clone,<br>  SpecCon = #constraint{}, % <---- HERE IS WHERE THE FIRST INSTANCE IS CREATED<br>  F = fun() -><br>    construct_Agent(Specie_Id, Agent_Id, SpecCon),<br>    clone_Agent(Specie_Id, CloneAgent_Id),<br>


    print(Agent_Id),<br>    print(CloneAgent_Id),<br>    delete_Agent(Agent_Id),<br>    delete_Agent(CloneAgent_Id)<br>  end,<br><br>  mnesia:transaction(F).<br><br></div>My question is thus, if I make a record with #constraint{}, does that mean that all of its values are by default set to undefined or the default values that were specified in records.hrl?<br>


<br><div><br></div></div><div><br><br><div>On Sat, Aug 16, 2014 at 2:35 AM, Steve Strong <span dir="ltr"><<a href="mailto:steve@srstrong.com" target="_blank">steve@srstrong.com</a>></span> wrote:<br><blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="auto"><div>I'm guessing that this:</div><div><br></div><div><pre style="margin-top:0px;margin-bottom:0px;width:748px"><div><font face="UICTFontTextStyleBody"><span style="white-space:normal;background-color:rgba(255,255,255,0)">  <span>Morphology</span> <span style="font-weight:bold">=</span> <span>SpecCon</span><span>#constraint.morphology</span><span>,</span></span></font></div>


</pre><div><br></div>Is setting Morphology to 'undefined' - that's what the stack trace looks to be saying.</div><div><br></div><div>Cheers,</div><div><br></div><div>Steve</div><div><br><span>Sent from my iPhone</span></div>


<div><div><div><br>On 16 Aug 2014, at 04:54, "Yves S. Garret" <<a href="mailto:yoursurrogategod@gmail.com" target="_blank">yoursurrogategod@gmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div>


<div><div dir="ltr"><div>Hello,<br><br></div>This is my code:<br><a href="https://gist.github.com/anonymous/5b9b2c55a7684f5386e2" target="_blank">https://gist.github.com/anonymous/5b9b2c55a7684f5386e2</a><br><div><br>When I run my code inside of erlang (17.0), this is the error that I get:<br>



7> genotype:create_test().<br>{aborted,{undef,[{morphology,undefined,[sensors],[]},<br>                 {morphology,get_InitSensors,1,<br>                             [{file,"morphology.erl"},{line,8}]},<br>


                 {genotype,construct_Cortex,3,<br>
                           [{file,"genotype.erl"},{line,41}]},<br>                 {genotype,construct_Agent,3,<br>                           [{file,"genotype.erl"},{line,20}]},<br>                 {genotype,'-create_test/0-fun-0-',0,<br>



                           [{file,"genotype.erl"},{line,434}]},<br>                 {mnesia_tm,apply_fun,3,[{file,"mnesia_tm.erl"},{line,833}]},<br>                 {mnesia_tm,execute_transaction,5,<br>



                            [{file,"mnesia_tm.erl"},{line,813}]},<br>                 {erl_eval,do_apply,6,[{file,"erl_eval.erl"},{line,661}]}]}}<br><br></div><div>genotype.erl and morphology.erl are in the directory, so why can't genotype's function call morphology's functions?  Or am I missing something else entirely?<br>



<br></div><div>Thanks.<br></div></div>
</div></div></blockquote></div></div><blockquote type="cite"><div><span>_______________________________________________</span><div><br><span>erlang-questions mailing list</span><br><span><a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a></span><br>


<span><a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a></span><br></div></div></blockquote></div></blockquote></div><br></div>
</div></div></span>
                 
                 
                 
                 
                </blockquote>
                 
                <div>
                    <br>
                </div>
            </div></div><br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>
</div></div></blockquote></div><br></div>