swarm-support
[Top][All Lists]
Advanced

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

Re: Win95 Permission Denied


From: Marcus G. Daniels
Subject: Re: Win95 Permission Denied
Date: 11 Apr 2000 11:10:55 -0700
User-agent: Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.4

>>>>> "DC" == David Conti <address@hidden> writes:

DC> I'm trying to compile the Schelling model from Benedict
DC> Stefansson's UCLA website as a test program.  The error I get is:
DC> "C:\Swarm-2.1\etc\swarm: Permission denied"

I had a few problems with Voting1.0.  The problem you ran into
is just that the include was hardcoded instead of using SWARMHOME.

There were a few places where messages were sent to nil.  I hacked
around them.  Those cases should probably be given more scrutiny.
There were some dead variables I removed in the diffs below, one
missing include file (for method declarations in Coalitions.h), and
usages of some obsolete uniform distribution names.

diff -c Voting1.0/Agent.m Voting1.0.1/Agent.m
*** Voting1.0/Agent.m   Wed Oct 27 17:44:15 1999
--- Voting1.0.1/Agent.m Tue Apr 11 11:48:18 2000
***************
*** 6,12 ****
  // Started on May 1999
  
  #import "Agent.h"
! #import <simtools.h>
  
  @implementation Agent 
  
--- 6,12 ----
  // Started on May 1999
  
  #import "Agent.h"
! #import "Coalition.h"
  
  @implementation Agent 
  
***************
*** 143,151 ****
  //  issue positions and A is a matrix of weights (salience on the diagonal, 
  //  separability off diagonal).
  -(double) estimateDistance: (id) otherAgent {
!   int i,j,k;
    double distance;
-   double sum;
    double w, y1, y2, z1, z2;
  
    distance=0;
--- 143,150 ----
  //  issue positions and A is a matrix of weights (salience on the diagonal, 
  //  separability off diagonal).
  -(double) estimateDistance: (id) otherAgent {
!   int i,j;
    double distance;
    double w, y1, y2, z1, z2;
  
    distance=0;
diff -c Voting1.0/Coalition.m Voting1.0.1/Coalition.m
*** Voting1.0/Coalition.m       Wed Oct 27 17:46:49 1999
--- Voting1.0.1/Coalition.m     Tue Apr 11 11:53:41 2000
***************
*** 131,137 ****
    newLink=[newLink createEnd];
    [newLink setColor: "pink"];
    inferiorNum=[anAgent getAgentID];
!   closestNum=[closestNeighbor getAgentID];
    //superiorNum=[superior getAgentID];
    [inferiorLinksList addLast: newLink];
  
--- 131,138 ----
    newLink=[newLink createEnd];
    [newLink setColor: "pink"];
    inferiorNum=[anAgent getAgentID];
!   if (closestNeighbor)
!     closestNum=[closestNeighbor getAgentID];
    //superiorNum=[superior getAgentID];
    [inferiorLinksList addLast: newLink];
  
***************
*** 140,146 ****
  
  -updateLinks { // Added for Version0.7
    int i;
!   id anAgent, aLink;
    
    [inferiorLinksList deleteAll];
    for (i=0; i<[inferiorsList getCount]; i++) {
--- 141,147 ----
  
  -updateLinks { // Added for Version0.7
    int i;
!   id anAgent;
    
    [inferiorLinksList deleteAll];
    for (i=0; i<[inferiorsList getCount]; i++) {
***************
*** 151,158 ****
  }
  -changeMyBorderColor: (int) aColor {  // Coalitions version
    const char * cColor;
-   int i;
-   id aLink;
    
    cColor=[colorSelector getColorName: aColor];
    [agentNode setBorderColor: cColor];
--- 152,157 ----
***************
*** 166,172 ****
  -movePlatform; {  // CHANGE THIS method for WeightedEuclideanDistance
    int i;
    float deltaX, deltaY;
!   id anAgent, aLink;
    
    anAgent=[self getClosestNeighbor];
    if (anAgent==nil) 
--- 165,171 ----
  -movePlatform; {  // CHANGE THIS method for WeightedEuclideanDistance
    int i;
    float deltaX, deltaY;
!   id anAgent;
    
    anAgent=[self getClosestNeighbor];
    if (anAgent==nil) 
diff -c Voting1.0/Makefile Voting1.0.1/Makefile
*** Voting1.0/Makefile  Thu Oct 14 13:38:17 1999
--- Voting1.0.1/Makefile        Tue Apr 11 11:45:47 2000
***************
*** 2,8 ****
  OBJECTS=main.o ObserverSwarm.o Parameters.o ModelSwarm.o Agent.o Voter.o 
Coalition.o ColorSelector.o
  APPLIBS=-lspace
  
! include /usr/etc/swarm/Makefile.appl
  
  main.o: main.m ObserverSwarm.h
  ObserverSwarm.o: ObserverSwarm.h ObserverSwarm.m
--- 2,8 ----
  OBJECTS=main.o ObserverSwarm.o Parameters.o ModelSwarm.o Agent.o Voter.o 
Coalition.o ColorSelector.o
  APPLIBS=-lspace
  
! include $(SWARMHOME)/etc/swarm/Makefile.appl
  
  main.o: main.m ObserverSwarm.h
  ObserverSwarm.o: ObserverSwarm.h ObserverSwarm.m
diff -c Voting1.0/ModelSwarm.m Voting1.0.1/ModelSwarm.m
*** Voting1.0/ModelSwarm.m      Thu Oct 21 21:21:05 1999
--- Voting1.0.1/ModelSwarm.m    Tue Apr 11 12:04:07 2000
***************
*** 82,88 ****
  
  -(id)formNewCoalition: (id) agent1 two: (id) agent2 {
    id newCoalition;
-   int number;
  
    // form the new Coalition
     newCoalition=[Coalition createBegin: self];
--- 82,87 ----
***************
*** 142,148 ****
      //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];
--- 141,147 ----
      //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];
***************
*** 202,208 ****
      mySuperior=[anAgent getSuperior];
      if  ((myNeighbor!=mySuperior) && 
        ([anAgent isMyInferior: myNeighbor]==0) &&
!       ([myNeighbor isACoalition]==1))
        if (([anAgent hasMajority]==0) && 
          ((([anAgent getHierarchyLevel]==0) && ([availableList 
getCount]==2))==0))
        {
--- 201,207 ----
      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))
        {
***************
*** 247,256 ****
  -findTheWinner {
    int i;
    int mostVotes;
!   id agentWithMostVotes;
    id anAgent;
    BOOL tie;
!   id winnerNode;
  
    mostVotes=0;
    tie=0;
--- 246,255 ----
  -findTheWinner {
    int i;
    int mostVotes;
!   id agentWithMostVotes = nil;
    id anAgent;
    BOOL tie;
!   id winnerNode = nil;
  
    mostVotes=0;
    tie=0;
***************
*** 338,344 ****
  -takeAPicture  {  // Added for Version0.7.6
    char filename[40];
    
!   sprintf(filename, "pic%07d.png", getCurrentTime());
    //[actionCache doTkEvents];
    [[[[[[Pixmap createBegin: [self getZone]]
        setWidget: graphCanvas]
--- 337,343 ----
  -takeAPicture  {  // Added for Version0.7.6
    char filename[40];
    
!   sprintf(filename, "pic%07ld.png", getCurrentTime());
    //[actionCache doTkEvents];
    [[[[[[Pixmap createBegin: [self getZone]]
        setWidget: graphCanvas]
***************
*** 350,356 ****
  
  -buildObjects {
    id aVoter; 
!   int pt,i;
   
    [super buildObjects];
  
--- 349,355 ----
  
  -buildObjects {
    id aVoter; 
!   int i;
   
    [super buildObjects];
  
***************
*** 365,372 ****
  
    // Also some random number generators  //PMMLCG1
    aGenerator=[MT19937gen create: [self getZone] setStateFromSeed: randomSeed];
!   uniformDouble=[UniformDouble create: [self getZone] setGenerator: 
aGenerator];
!   uniformInteger=[UniformInteger create: [self getZone] setGenerator: 
aGenerator];
  
    // Each pass creates a voter and adds him to the voter and available lists
    for (i=0; i<numVoters; i++) {
--- 364,371 ----
  
    // Also some random number generators  //PMMLCG1
    aGenerator=[MT19937gen create: [self getZone] setStateFromSeed: randomSeed];
!   uniformDouble=[UniformDoubleDist create: [self getZone] setGenerator: 
aGenerator];
!   uniformInteger=[UniformIntegerDist create: [self getZone] setGenerator: 
aGenerator];
  
    // Each pass creates a voter and adds him to the voter and available lists
    for (i=0; i<numVoters; i++) {
***************
*** 422,438 ****
  -step {
    [self updateSalience];
   
!   if ((movePlatforms==1) && ([winnerAgent getNumberOfVoters]>(numVoters/2)))
      {
!       [coalitionList forEach: M(findClosestNeighbor:) : agentList];
!       [coalitionList forEach: M(movePlatform)];
!       
!       // See if the agents want to defect and then do the defections
!       [self checkForDefections];
!     
!       //[self textOutputDendogram];
      }
-   
    // Find your closest neighbor
    [availableList forEach: M(findClosestNeighbor:) : (id) availableList];
    // Merge with your closest neighbor if he agrees
--- 421,440 ----
  -step {
    [self updateSalience];
   
!   if (winnerAgent)
      {
!       if ((movePlatforms == 1)
!           && [winnerAgent getNumberOfVoters] > numVoters / 2)
!         {
!           [coalitionList forEach: M(findClosestNeighbor:) : agentList];
!           [coalitionList forEach: M(movePlatform)];
!           
!           // See if the agents want to defect and then do the defections
!           [self checkForDefections];
!           
!           //[self textOutputDendogram];
!         }
      }
    // Find your closest neighbor
    [availableList forEach: M(findClosestNeighbor:) : (id) availableList];
    // Merge with your closest neighbor if he agrees

                  ==================================
   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]