swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems with Swarm on LinuxPPC


From: Marcus G. Daniels
Subject: Re: Problems with Swarm on LinuxPPC
Date: 24 May 2000 08:58:51 -0700
User-agent: Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.4

>>>>> "DS" == Darren Schreiber <address@hidden> writes:

DS> I checked a number of other *.o files using the nm command and got
DS> the same.  I have put Voting1.00.3 in the incoming directory.

I don't get that using Swarm 2.1.1 and gcc-2.95.2 on LinuxPPC 1999 Q3.
Perhaps the older compiler has problems with carriage returns.  You
could try stripping them out with a command like:

$ for i in *.[hm] ; do tr -d '\r' < $i > $i.new ; mv $i.new $i ; done

You have some nil method problems.  These patches are not fixes, but
will point you at the offending code, i.e. from which you can backtrack to
find some fix that avoids the problem entirely.

Also, Agent.m should include Coalition.h, and agentWithMostVotes may
not be initialized.

diff -w -r -c Voting1.00.3/Agent.m Voting1.00.3a/Agent.m
*** Voting1.00.3/Agent.m        Tue May 23 18:58:52 2000
--- Voting1.00.3a/Agent.m       Wed May 24 09:31:50 2000
***************
*** 6,11 ****
--- 6,12 ----
  // Started on May 1999
  
  #import "Agent.h"
+ #import "Coalition.h"
  #import <simtools.h>
  
  @implementation Agent 
diff -w -r -c Voting1.00.3/Coalition.m Voting1.00.3a/Coalition.m
*** Voting1.00.3/Coalition.m    Tue May 23 12:05:52 2000
--- Voting1.00.3a/Coalition.m   Wed May 24 09:39:23 2000
***************
*** 131,137 ****
    newLink=[newLink createEnd];
    [newLink setColor: "pink"];
    inferiorNum=[anAgent getAgentID];
!   closestNum=[closestNeighbor getAgentID];
    //superiorNum=[superior getAgentID];
    [inferiorLinksList addLast: newLink];
  
--- 131,137 ----
    newLink=[newLink createEnd];
    [newLink setColor: "pink"];
    inferiorNum=[anAgent getAgentID];
!   closestNum=closestNeighbor ? [closestNeighbor getAgentID] : 0;
    //superiorNum=[superior getAgentID];
    [inferiorLinksList addLast: newLink];
  
diff -w -r -c Voting1.00.3/ModelSwarm.m Voting1.00.3a/ModelSwarm.m
*** Voting1.00.3/ModelSwarm.m   Tue May 23 19:49:04 2000
--- Voting1.00.3a/ModelSwarm.m  Wed May 24 09:45:21 2000
***************
*** 143,149 ****
      //printf("The number is %d. ",i);
      agent1=[availableList atOffset: i];
      agent2=[agent1 getClosestNeighbor];
!     agent3=[agent2 getClosestNeighbor];
      if (agent1==agent3)
        {
        newCoalition=[self formNewCoalition: agent1 two: agent2];
--- 143,149 ----
      //printf("The number is %d. ",i);
      agent1=[availableList atOffset: i];
      agent2=[agent1 getClosestNeighbor];
!     agent3=agent2 ? [agent2 getClosestNeighbor] : nil;
      if (agent1==agent3)
        {
        newCoalition=[self formNewCoalition: agent1 two: agent2];
***************
*** 203,209 ****
      mySuperior=[anAgent getSuperior];
      if  ((myNeighbor!=mySuperior) && 
        ([anAgent isMyInferior: myNeighbor]==0) &&
!       ([myNeighbor isACoalition]==1))
        if (([anAgent hasMajority]==0) && 
          ((([anAgent getHierarchyLevel]==0) && ([availableList 
getCount]==2))==0))
        {
--- 203,209 ----
      mySuperior=[anAgent getSuperior];
      if  ((myNeighbor!=mySuperior) && 
        ([anAgent isMyInferior: myNeighbor]==0) &&
!       (myNeighbor && [myNeighbor isACoalition]==1))
        if (([anAgent hasMajority]==0) && 
          ((([anAgent getHierarchyLevel]==0) && ([availableList 
getCount]==2))==0))
        {
***************
*** 248,254 ****
  -findTheWinner {
    int i;
    int mostVotes;
!   id agentWithMostVotes;
    id anAgent;
    BOOL tie;
    id winnerNode;
--- 248,254 ----
  -findTheWinner {
    int i;
    int mostVotes;
!   id agentWithMostVotes = nil;
    id anAgent;
    BOOL tie;
    id winnerNode;
***************
*** 425,431 ****
  -step {
    [self updateSalience];
   
!   if ([winnerAgent hasMajority])
      trigger=1;
  
    if ((movePlatforms==1) && trigger)
--- 425,431 ----
  -step {
    [self updateSalience];
   
!   if (winnerAgent && [winnerAgent hasMajority])
      trigger=1;
  
    if ((movePlatforms==1) && trigger)

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]