Exemplo n.º 1
0
 /// <summary>
 /// Use this constructer to tell the codelet which analogy to examine.
 /// Otherwise, it picks randomly.
 /// </summary>
 /// <param name="urgency"></param>
 /// <param name="parent"></param>
 /// <param name="coderack"></param>
 /// <param name="workspace"></param>
 /// <param name="slipnet"></param>
 /// <param name="notes"></param>
 public SuggestSameLengthAnalogyCodelet(int urgency, Codelet parent, Coderack coderack, Workspace workspace, Slipnet slipnet, Group sourceGroup)
     : base("Suggest Same Length Analogy", urgency, parent, coderack, workspace, slipnet)
 {
     this.sourceGroup = sourceGroup;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Use this constructer to tell the codelet which group to examine.
 /// Otherwise, it picks randomly.
 /// </summary>
 /// <param name="urgency"></param>
 /// <param name="parent"></param>
 /// <param name="coderack"></param>
 /// <param name="workspace"></param>
 /// <param name="slipnet"></param>
 /// <param name="notes"></param>
 public SuggestGroupFromExpectationCodelet(int urgency, Codelet parent, Coderack coderack, Workspace workspace, Slipnet slipnet, ExpectedGroup eg)
     : base("Suggest Group From Expectation", urgency, parent, coderack, workspace, slipnet)
 {
     this.eg = eg;
 }
 /// <summary>
 /// Use this constructer to tell the codelet which measure to examine.
 /// Otherwise, it picks one randomly.
 /// </summary>
 /// <param name="urgency"></param>
 /// <param name="parent"></param>
 /// <param name="coderack"></param>
 /// <param name="workspace"></param>
 /// <param name="slipnet"></param>
 /// <param name="notes"></param>
 public ExamineLinkedPairsCodelet(int urgency, Codelet parent, Coderack coderack, Workspace workspace, Slipnet slipnet, MeasureLink link)
     : base("Examine Linked Pairs", urgency, parent, coderack, workspace, slipnet)
 {
     this.link = link;
 }
 /// <summary>
 /// Use this constructer to tell the codelet which group to examine.
 /// Otherwise, it picks one randomly.
 /// </summary>
 /// <param name="urgency"></param>
 /// <param name="parent"></param>
 /// <param name="coderack"></param>
 /// <param name="workspace"></param>
 /// <param name="slipnet"></param>
 /// <param name="notes"></param>
 public GroupReasonMusicalForcesClosureCodelet(int urgency, Codelet parent, Coderack coderack, Workspace workspace, Slipnet slipnet,
                                               Group group)
     : base("Group Reason Musical Forces Closure", urgency, parent, coderack, workspace, slipnet)
 {
     this.group = group;
 }
 /// <summary>
 /// Use this constructer to tell the codelet which measure to examine.
 /// Otherwise, it picks one randomly.
 /// </summary>
 /// <param name="urgency"></param>
 /// <param name="parent"></param>
 /// <param name="coderack"></param>
 /// <param name="workspace"></param>
 /// <param name="slipnet"></param>
 /// <param name="notes"></param>
 public LookForTranspositionRelationshipCodelet(int urgency, Codelet parent, Coderack coderack, Workspace workspace, Slipnet slipnet,
                                                RelationshipMelodyContour cr)
     : base("Look for Transposition Relationship", urgency, parent, coderack, workspace, slipnet)
 {
     this.cr = cr;
 }
 /// <summary>
 /// Use this constructer to tell the codelet which link to examine.
 /// Otherwise, it picks one randomly.
 /// </summary>
 /// <param name="urgency"></param>
 /// <param name="parent"></param>
 /// <param name="coderack"></param>
 /// <param name="workspace"></param>
 /// <param name="slipnet"></param>
 /// <param name="notes"></param>
 public GenerateExpectedGroupCopyCodelet(int urgency, Codelet parent, Coderack coderack, Workspace workspace, Slipnet slipnet, Group group)
     : base("Generate Expected Group Copy", urgency, parent, coderack, workspace, slipnet)
 {
     this.group = group;
 }
Exemplo n.º 7
0
 /// <summary>
 /// Use this constructer to tell the codelet which group to examine.
 /// Otherwise, it picks randomly.
 /// </summary>
 /// <param name="urgency"></param>
 /// <param name="parent"></param>
 /// <param name="coderack"></param>
 /// <param name="workspace"></param>
 /// <param name="slipnet"></param>
 /// <param name="notes"></param>
 public SuggestLinkFromExpectationCodelet(int urgency, Codelet parent, Coderack coderack, Workspace workspace, Slipnet slipnet, ExpectedMeasureLink elink)
     : base("Suggest Link From Expectation", urgency, parent, coderack, workspace, slipnet)
 {
     this.elink = elink;
 }
Exemplo n.º 8
0
 public virtual void PostCodelets(Coderack coderack, Workspace workspace, Slipnet slipnet)
 {
 }
Exemplo n.º 9
0
        private static void Init()
        {
            pausing = true;
            TextWriter tw;

            if (GUIenabled)
            {
                // Get and update the program run number.
                try {
                    TextReader tr     = new StreamReader(@"C:\RhythmcatScreenshots\config.txt");
                    string     numStr = tr.ReadToEnd().Trim();
                    tr.Close();
                    programRunNum = int.Parse(numStr) + 1;
                } catch {
                    programRunNum = 1;
                }
                tw = new StreamWriter(@"C:\RhythmcatScreenshots\config.txt", false);
                tw.WriteLine(programRunNum);
                tw.Close();
            }

            workspace = new Workspace(programRunNum, GUIenabled, curMelodyIndex);

            coderack = new Coderack(workspace);
            slipnet  = new Slipnet(coderack, workspace);

            workspace.Coderack = coderack;
            workspace.Slipnet  = slipnet;
            coderack.Slipnet   = slipnet;           // todo must be in this order to get coderack and slipnet linked to each other.

            if (GUIenabled)
            {
                workspace.CreateTheForms();
            }

            // Reset the big objects.
            workspace.Reset();
            coderack.Reset();
            slipnet.Reset();

            if (GUIenabled)
            {
                workspace.frmWorkspace.setProgramSpeedEvent += new EventHandler <WorkspaceForm.SetProgramSpeedEventArgs>(frmWorkspace_setProgamSpeedEvent);
                workspace.frmWorkspace.setDetailLevelEvent  += new EventHandler <WorkspaceForm.SetDetailLevelEventArgs>(frmWorkspace_setDetailLevelEvent);
                workspace.frmWorkspace.restartEvent         += new EventHandler <WorkspaceForm.RestartEventArgs>(frmWorkspace_restartEvent);
                workspace.frmWorkspace.pauseEvent           += new EventHandler <EventArgs>(frmWorkspace_pauseEvent);
                workspace.Close += new EventHandler <EventArgs>(workspace_Close);
            }

            List <Assembly> assemblies = new List <Assembly>();             // the list of assemblies containing codelets.

            assemblies.Add(Assembly.GetExecutingAssembly());                // Adds the musicat assembly.

            //assemblies.Add(Assembly.GetAssembly(typeof(MeasureLinkerCodelet)));	// Add the Codelets assembly.

            // Prepopulate the coderack with the codelets found in the source code tagged with the CodeletAttribute.
            coderack.Assemblies = assemblies;
            coderack.Populate();

            if (GUIenabled)
            {
                // Write a file containing the list of active codelets for this run.
                tw = new StreamWriter(string.Format(@"C:\RhythmcatScreenshots\codelets-run-{0}.txt", programRunNum), false);
                foreach (string name in coderack.GetActiveCodeletNames())
                {
                    tw.WriteLine(name);
                }
                tw.Close();
            }

            // Setup the slipnet.
            slipnet.Initialize();

            if (GUIenabled)
            {
                Thread.Sleep(100);

                lock (restartLock) {
                    if (!restarting)
                    {
                        workspace.Draw(coderack);
                    }
                }
            }
        }
Exemplo n.º 10
0
 public StrengthenExpectationCodelet(int urgency, Codelet parent, Coderack coderack, Workspace workspace, Slipnet slipnet)
     : base("Strengthen Expectation", urgency, parent, coderack, workspace, slipnet)
 {
 }
Exemplo n.º 11
0
 /// <summary>
 /// Use this constructer to tell the codelet which group to examine.
 /// Otherwise, it picks one randomly.
 /// </summary>
 /// <param name="urgency"></param>
 /// <param name="parent"></param>
 /// <param name="coderack"></param>
 /// <param name="workspace"></param>
 /// <param name="slipnet"></param>
 /// <param name="notesStrengthenExpectationCodeletparam>
 public StrengthenExpectationCodelet(int urgency, Codelet parent, Coderack coderack, Workspace workspace, Slipnet slipnet,
                                     ExpectedGroup group)
     : base("Strengthen Expectation", urgency, parent, coderack, workspace, slipnet)
 {
     this.group = group;
 }
 /// <summary>
 /// Use this constructer to tell the codelet which group to examine.
 /// Otherwise, it picks one randomly.
 /// </summary>
 /// <param name="urgency"></param>
 /// <param name="parent"></param>
 /// <param name="coderack"></param>
 /// <param name="workspace"></param>
 /// <param name="slipnet"></param>
 /// <param name="notes"></param>
 public GroupReasonHierarchyEndCodelet(int urgency, Codelet parent, Coderack coderack, Workspace workspace, Slipnet slipnet,
                                       Group group)
     : base("Group Reason Hierarchy End", urgency, parent, coderack, workspace, slipnet)
 {
     this.group = group;
 }
 /// <summary>
 /// Use this constructer to tell the codelet which measure to examine.
 /// Otherwise, it picks one randomly.
 /// </summary>
 /// <param name="urgency"></param>
 /// <param name="parent"></param>
 /// <param name="coderack"></param>
 /// <param name="workspace"></param>
 /// <param name="slipnet"></param>
 /// <param name="notes"></param>
 public OldMeasureLinkBreakerCodelet(int urgency, Codelet parent, Coderack coderack, Workspace workspace, Slipnet slipnet, Analogy analogy)
     : base("Old Measure Link Breaker", urgency, parent, coderack, workspace, slipnet)
 {
     this.analogy = analogy;
 }
 /// <summary>
 /// Use this constructer to tell the codelet which measure to examine.
 /// Otherwise, it picks one randomly.
 /// </summary>
 /// <param name="urgency"></param>
 /// <param name="parent"></param>
 /// <param name="coderack"></param>
 /// <param name="workspace"></param>
 /// <param name="slipnet"></param>
 /// <param name="notes"></param>
 public OldMeasureLinkBreakerCodelet(int urgency, Codelet parent, Coderack coderack, Workspace workspace, Slipnet slipnet, MeasureLink link)
     : base("Old Measure Link Breaker", urgency, parent, coderack, workspace, slipnet)
 {
     this.link = link;
 }
 /// <summary>
 /// Use this constructer to tell the codelet which analogy to examine.
 /// Otherwise, it picks randomly.
 /// </summary>
 /// <param name="urgency"></param>
 /// <param name="parent"></param>
 /// <param name="coderack"></param>
 /// <param name="workspace"></param>
 /// <param name="slipnet"></param>
 /// <param name="notes"></param>
 public SuggestParallelAnalogyCodelet(int urgency, Codelet parent, Coderack coderack, Workspace workspace, Slipnet slipnet, Analogy sourceAnalogy)
     : base("Suggest Parallel Analogy", urgency, parent, coderack, workspace, slipnet)
 {
     this.sourceAnalogy = sourceAnalogy;
 }
Exemplo n.º 16
0
 public LookForAntecedentConsequentRelationshipCodelet(int urgency, Codelet parent, Coderack coderack, Workspace workspace, Slipnet slipnet)
     : base("Look for Antecedent-Consequent Relationship", urgency, parent, coderack, workspace, slipnet)
 {
 }
Exemplo n.º 17
0
 /// <summary>
 /// Use this constructer to tell the codelet which group to examine.
 /// Otherwise, it picks one randoml.y
 /// </summary>
 /// <param name="urgency"></param>
 /// <param name="parent"></param>
 /// <param name="coderack"></param>
 /// <param name="workspace"></param>
 /// <param name="slipnet"></param>
 /// <param name="notes"></param>
 public AddRelationshipsToAnalogyCodelet(int urgency, Codelet parent, Coderack coderack, Workspace workspace, Slipnet slipnet,
                                         Analogy analogy)
     : base("Add Relationships To Analogy", urgency, parent, coderack, workspace, slipnet)
 {
     this.analogy = analogy;
 }
Exemplo n.º 18
0
 /// <summary>
 /// Use this constructer to tell the codelet which measure to examine.
 /// Otherwise, it picks one randomly.
 /// </summary>
 /// <param name="urgency"></param>
 /// <param name="parent"></param>
 /// <param name="coderack"></param>
 /// <param name="workspace"></param>
 /// <param name="slipnet"></param>
 /// <param name="notes"></param>
 public LookForAntecedentConsequentRelationshipCodelet(int urgency, Codelet parent, Coderack coderack, Workspace workspace, Slipnet slipnet,
                                                       GroupElement ge1, GroupElement ge2)
     : base("Look for Antecedent-Consequent Relationship", urgency, parent, coderack, workspace, slipnet)
 {
     this.ge1 = ge1;
     this.ge2 = ge2;
 }
Exemplo n.º 19
0
 public SuggestLinkFromExpectationCodelet(int urgency, Codelet parent, Coderack coderack, Workspace workspace, Slipnet slipnet)
     : base("Suggest Link From Expectation", urgency, parent, coderack, workspace, slipnet)
 {
 }
Exemplo n.º 20
0
 public GroupReasonEndPitchCodelet(int urgency, Codelet parent, Coderack coderack, Workspace workspace, Slipnet slipnet)
     : base("Group Reason End Pitch", urgency, parent, coderack, workspace, slipnet)
 {
 }
Exemplo n.º 21
0
 /// <summary>
 /// Use this constructer to tell the codelet which group to examine.
 /// Otherwise, it picks one randomly.
 /// </summary>
 /// <param name="urgency"></param>
 /// <param name="parent"></param>
 /// <param name="coderack"></param>
 /// <param name="workspace"></param>
 /// <param name="slipnet"></param>
 /// <param name="notes"></param>
 public GroupPenaltyHierarchyCrossingCodelet(int urgency, Codelet parent, Coderack coderack, Workspace workspace, Slipnet slipnet,
                                             Group group)
     : base("Group Penalty Hierarchy Crossing", urgency, parent, coderack, workspace, slipnet)
 {
     this.group = group;
 }
Exemplo n.º 22
0
 /// <summary>
 /// Use this constructer to tell the codelet which analogy to examine.
 /// Otherwise, it picks randomly.
 /// </summary>
 /// <param name="urgency"></param>
 /// <param name="parent"></param>
 /// <param name="coderack"></param>
 /// <param name="workspace"></param>
 /// <param name="slipnet"></param>
 /// <param name="notes"></param>
 public StoreStrongAnalogy(int urgency, Codelet parent, Coderack coderack, Workspace workspace, Slipnet slipnet, Analogy analogy)
     : base("Store Strong Analogy", urgency, parent, coderack, workspace, slipnet)
 {
     this.analogy = analogy;
 }
 public LookForTranspositionRelationshipCodelet(int urgency, Codelet parent, Coderack coderack, Workspace workspace, Slipnet slipnet)
     : base("Look for Transposition Relationship", urgency, parent, coderack, workspace, slipnet)
 {
 }
Exemplo n.º 24
0
 /// <summary>
 /// Use this constructer to tell the codelet which analogy to examine.
 /// Otherwise, it picks one randomly.
 /// </summary>
 /// <param name="urgency"></param>
 /// <param name="parent"></param>
 /// <param name="coderack"></param>
 /// <param name="workspace"></param>
 /// <param name="slipnet"></param>
 /// <param name="notes"></param>
 public FormLabelFromAnalogy(int urgency, Codelet parent, Coderack coderack, Workspace workspace, Slipnet slipnet, Analogy a)
     : base("Form Label Assigner", urgency, parent, coderack, workspace, slipnet)
 {
     this.a = a;
 }
Exemplo n.º 25
0
 /// <summary>
 /// Use this constructer to tell the codelet which group to examine.
 /// Otherwise, it picks one randomly.
 /// </summary>
 /// <param name="urgency"></param>
 /// <param name="parent"></param>
 /// <param name="coderack"></param>
 /// <param name="workspace"></param>
 /// <param name="slipnet"></param>
 /// <param name="notes"></param>
 public GroupReasonRhythmGapCodelet(int urgency, Codelet parent, Coderack coderack, Workspace workspace, Slipnet slipnet,
                                    Group group)
     : base("Group Reason Rhythmic Gap", urgency, parent, coderack, workspace, slipnet)
 {
     this.group = group;
 }
Exemplo n.º 26
0
 public SuggestSameLengthAnalogyCodelet(int urgency, Codelet parent, Coderack coderack, Workspace workspace, Slipnet slipnet)
     : base("Suggest Same Length Analogy", urgency, parent, coderack, workspace, slipnet)
 {
 }
Exemplo n.º 27
0
 public MeasureLinkerCodelet(int urgency, Codelet parent, Coderack coderack, Workspace workspace, Slipnet slipnet)
     : base("Measure Linker", urgency, parent, coderack, workspace, slipnet)
 {
 }
Exemplo n.º 28
0
 public ExamineLinkedPairsCodelet(int urgency, Codelet parent, Coderack coderack, Workspace workspace, Slipnet slipnet)
     : base("Examine Linked Pairs", urgency, parent, coderack, workspace, slipnet)
 {
 }