Loading ...
Sorry, an error occurred while loading the content.
 

Model Needing Help

Expand Messages
  • Ledesma, Rodolfo
    Hi. I m a new user of Netlogo and I m struggling with my first model. My code is shown below. I would appreciate it if someone can help me do it right. I m
    Message 1 of 8 , Nov 5, 2002
      Hi.

      I'm a new user of Netlogo and I'm struggling with my first model. My code is
      shown below. I would appreciate it if someone can help me do it right.

      I'm trying to construct a simple model of interacting buyers and sellers,
      both agents equipped with minimal rules, similar to the one described by
      Pietro Terna (JASS, 1998; http://jasss.soc.surrey.ac.uk/1/2/4.html).
      Essentially, I'd like to do an adaptation if possible of his model into
      Netlogo.

      I'm starting with 10 buyers and 10 sellers for now, meaning two types of
      agents. My plan is for a seller to initially decide on a range of prices to
      sell a pretend good. The buyer on the other hand offers to the seller a
      price it wants to buy the pretend good.

      At every simulation or tick, buyers start looking for a seller of the
      pretend good who I would like to remain stationary while the buyers roam
      around randomly. Thus, the matching of a buyer with a seller is random, if
      it takes place at all during a tick.

      An exchange occurs if the price asked by the seller is lower than the level
      fixed by the buyer. (If I get past the matching part of the coding, my plan
      is for a buyer who has not had an exchange, say, in the past couple of
      ticks, to raise its offer price. Conversely, if a seller has not had an
      exchange in the past couple of ticks, it lowers its asking price.)

      At each time t (tick) I'd like each agent to increase its transaction
      counter by 1 unit if it makes a trade and decrease it by 1 unit if it
      doesn't trade.

      Below is my attempt at programming in NetLogo. I would appreciate any help
      you can send my way.

      Thanks.

      Rudy Ledesma
      Marian College
      Fond du Lac, WI 543935
      920-923-8149

      ---------------------------------------------

      globals [ clock ]

      breeds [ buyer seller ]

      turtles-own [ buying-price selling-price ]

      to setup
      ca
      initialize-variables
      create-buyer number
      ask buyer [ set color red ]
      ask buyer [ fd random screen-edge-y ]
      create-seller 20
      ask seller [ set color white ]
      ask seller [ fd random screen-edge-x ]
      end

      to go
      ask turtles [ trade ]
      ask buyer [
      fd 1
      rt random 360
      lt random 360
      wait .30
      buy
      ]
      ask seller [
      sell
      ]
      end

      to initialize-variables
      end

      to buy
      set buying-price 5
      search-for-seller
      end


      to sell
      set selling-price random 10
      end

      to search-for-seller
      ask turtles in-radius 0 with [ selling-price = 4 ] [ set color green ]
      end


      to trade
      if(buying-price > selling-price) [ set color turquoise ]
      end

      ------------------------------------------------------------------



      -----Original Message-----
      From: Seth Tisue [mailto:seth@...]
      Sent: Monday, October 14, 2002 5:40 PM
      To: netlogo-users@yahoogroups.com
      Subject: Re: [netlogo-users] Heading predefined variable


      >>>>> "Mitch" == Mitch Quinn <mitchquinn@...> writes:

      Mitch> I'm surprised though that all of the other variables Mitch> are
      explained in the user manual. Was 'heading' just Mitch> forgotten?

      Yes -- thanks for calling our attention to this. We'll correct this for
      NetLogo 1.2.

      ==
      Seth Tisue / seth@... / (847) 467-2814
      lead developer, NetLogo http://ccl.northwestern.edu/netlogo/
      Center for Connected Learning and Computer-Based Modeling School of
      Education and Social Policy / Department of Computer Science Northwestern
      University


      To unsubscribe from this group, send an email to:
      netlogo-users-unsubscribe@yahoogroups.com



      Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    • Cheng Youjiang
      Hi Rudy, I m a new user too. I tried and created the attached model. Does it satisfy your requirements? Regards, Youjiang ... breeds [buyer seller] turtles-own
      Message 2 of 8 , Nov 6, 2002
        Hi Rudy,

        I'm a new user too. I tried and created the attached model. Does it
        satisfy your requirements?

        Regards,
        Youjiang

        > Hi.
        >
        > I'm a new user of Netlogo and I'm struggling with my first model. My
        > code is shown below. I would appreciate it if someone can help me do it
        > right.
        >
        > I'm trying to construct a simple model of interacting buyers and
        > sellers, both agents equipped with minimal rules, similar to the one
        > described by Pietro Terna (JASS, 1998;
        > http://jasss.soc.surrey.ac.uk/1/2/4.html). Essentially, I'd like to do
        > an adaptation if possible of his model into Netlogo.
        >
        > I'm starting with 10 buyers and 10 sellers for now, meaning two types of
        > agents. My plan is for a seller to initially decide on a range of prices
        > to sell a pretend good. The buyer on the other hand offers to the seller
        > a price it wants to buy the pretend good.
        >
        > At every simulation or tick, buyers start looking for a seller of the
        > pretend good who I would like to remain stationary while the buyers roam
        > around randomly. Thus, the matching of a buyer with a seller is random,
        > if it takes place at all during a tick.
        >
        > An exchange occurs if the price asked by the seller is lower than the
        > level fixed by the buyer. (If I get past the matching part of the
        > coding, my plan is for a buyer who has not had an exchange, say, in the
        > past couple of ticks, to raise its offer price. Conversely, if a seller
        > has not had an exchange in the past couple of ticks, it lowers its
        > asking price.)
        >
        > At each time t (tick) I'd like each agent to increase its transaction
        > counter by 1 unit if it makes a trade and decrease it by 1 unit if it
        > doesn't trade.
        >
        > Below is my attempt at programming in NetLogo. I would appreciate any
        > help you can send my way.
        >
        > Thanks.
        >
        > Rudy Ledesma
        > Marian College
        > Fond du Lac, WI 543935
        > 920-923-8149
        >
        > ---------------------------------------------
        >
        > globals [ clock ]
        >
        > breeds [ buyer seller ]
        >
        > turtles-own [ buying-price selling-price ]
        >
        > to setup
        > ca
        > initialize-variables
        > create-buyer number
        > ask buyer [ set color red ]
        > ask buyer [ fd random screen-edge-y ]
        > create-seller 20
        > ask seller [ set color white ]
        > ask seller [ fd random screen-edge-x ]
        > end
        >
        > to go
        > ask turtles [ trade ]
        > ask buyer [
        > fd 1
        > rt random 360
        > lt random 360
        > wait .30
        > buy
        > ]
        > ask seller [
        > sell
        > ]
        > end
        >
        > to initialize-variables
        > end
        >
        > to buy
        > set buying-price 5
        > search-for-seller
        > end
        >
        >
        > to sell
        > set selling-price random 10
        > end
        >
        > to search-for-seller
        > ask turtles in-radius 0 with [ selling-price = 4 ] [ set color green
        > ]
        > end
        >
        >
        > to trade
        > if(buying-price > selling-price) [ set color turquoise ]
        > end
        >
        > ------------------------------------------------------------------
        >
        >
        >
        > -----Original Message-----
        > From: Seth Tisue [mailto:seth@...]
        > Sent: Monday, October 14, 2002 5:40 PM
        > To: netlogo-users@yahoogroups.com
        > Subject: Re: [netlogo-users] Heading predefined variable
        >
        >
        >>>>>> "Mitch" == Mitch Quinn <mitchquinn@...> writes:
        >
        > Mitch> I'm surprised though that all of the other variables Mitch> are
        > explained in the user manual. Was 'heading' just Mitch> forgotten?
        >
        > Yes -- thanks for calling our attention to this. We'll correct this for
        > NetLogo 1.2.
        >
        > ==
        > Seth Tisue / seth@... / (847) 467-2814
        > lead developer, NetLogo http://ccl.northwestern.edu/netlogo/
        > Center for Connected Learning and Computer-Based Modeling School of
        > Education and Social Policy / Department of Computer Science
        > Northwestern University
        >
        >
        > To unsubscribe from this group, send an email to:
        > netlogo-users-unsubscribe@yahoogroups.com
        >
        >
        >
        > Your use of Yahoo! Groups is subject to
        > http://docs.yahoo.com/info/terms/
        >
        >
        >
        > To unsubscribe from this group, send an email to:
        > netlogo-users-unsubscribe@yahoogroups.com
        >
        >
        >
        > Your use of Yahoo! Groups is subject to
        > http://docs.yahoo.com/info/terms/
      • Ledesma, Rodolfo
        Youjiang, Hi. Thanks for the encouraging note. Right now the model doesn t work because I don t know if the code is right. When a buyer-turtle meets up with a
        Message 3 of 8 , Nov 7, 2002
          Youjiang,

          Hi.

          Thanks for the encouraging note. Right now the model doesn't work because I
          don't know if the code is right. When a buyer-turtle meets up with a
          seller-turtle and the buye-turtle's buying-price is above the
          seller-turtle's selling price or if there is at least a match, the color of
          the seller-turtle don't seem to change.

          Best,

          Rudy

          -----Original Message-----
          From: Cheng Youjiang [mailto:chengyou@...]
          Sent: Wednesday, November 06, 2002 9:13 PM
          To: rledesma@...
          Cc: netlogo-users@yahoogroups.com
          Subject: Re: [netlogo-users] Model Needing Help


          Hi Rudy,

          I'm a new user too. I tried and created the attached model. Does it satisfy
          your requirements?

          Regards,
          Youjiang

          > Hi.
          >
          > I'm a new user of Netlogo and I'm struggling with my first model. My
          > code is shown below. I would appreciate it if someone can help me do
          > it right.
          >
          > I'm trying to construct a simple model of interacting buyers and
          > sellers, both agents equipped with minimal rules, similar to the one
          > described by Pietro Terna (JASS, 1998;
          > http://jasss.soc.surrey.ac.uk/1/2/4.html). Essentially, I'd like to do
          > an adaptation if possible of his model into Netlogo.
          >
          > I'm starting with 10 buyers and 10 sellers for now, meaning two types
          > of agents. My plan is for a seller to initially decide on a range of
          > prices to sell a pretend good. The buyer on the other hand offers to
          > the seller a price it wants to buy the pretend good.
          >
          > At every simulation or tick, buyers start looking for a seller of the
          > pretend good who I would like to remain stationary while the buyers
          > roam around randomly. Thus, the matching of a buyer with a seller is
          > random, if it takes place at all during a tick.
          >
          > An exchange occurs if the price asked by the seller is lower than the
          > level fixed by the buyer. (If I get past the matching part of the
          > coding, my plan is for a buyer who has not had an exchange, say, in
          > the past couple of ticks, to raise its offer price. Conversely, if a
          > seller has not had an exchange in the past couple of ticks, it lowers
          > its asking price.)
          >
          > At each time t (tick) I'd like each agent to increase its transaction
          > counter by 1 unit if it makes a trade and decrease it by 1 unit if it
          > doesn't trade.
          >
          > Below is my attempt at programming in NetLogo. I would appreciate any
          > help you can send my way.
          >
          > Thanks.
          >
          > Rudy Ledesma
          > Marian College
          > Fond du Lac, WI 543935
          > 920-923-8149
          >
          > ---------------------------------------------
          >
          > globals [ clock ]
          >
          > breeds [ buyer seller ]
          >
          > turtles-own [ buying-price selling-price ]
          >
          > to setup
          > ca
          > initialize-variables
          > create-buyer number
          > ask buyer [ set color red ]
          > ask buyer [ fd random screen-edge-y ]
          > create-seller 20
          > ask seller [ set color white ]
          > ask seller [ fd random screen-edge-x ]
          > end
          >
          > to go
          > ask turtles [ trade ]
          > ask buyer [
          > fd 1
          > rt random 360
          > lt random 360
          > wait .30
          > buy
          > ]
          > ask seller [
          > sell
          > ]
          > end
          >
          > to initialize-variables
          > end
          >
          > to buy
          > set buying-price 5
          > search-for-seller
          > end
          >
          >
          > to sell
          > set selling-price random 10
          > end
          >
          > to search-for-seller
          > ask turtles in-radius 0 with [ selling-price = 4 ] [ set color
          > green ] end
          >
          >
          > to trade
          > if(buying-price > selling-price) [ set color turquoise ] end
          >
          > ------------------------------------------------------------------
          >
          >
          >
          > -----Original Message-----
          > From: Seth Tisue [mailto:seth@...]
          > Sent: Monday, October 14, 2002 5:40 PM
          > To: netlogo-users@yahoogroups.com
          > Subject: Re: [netlogo-users] Heading predefined variable
          >
          >
          >>>>>> "Mitch" == Mitch Quinn <mitchquinn@...> writes:
          >
          > Mitch> I'm surprised though that all of the other variables Mitch>
          > are explained in the user manual. Was 'heading' just Mitch>
          > forgotten?
          >
          > Yes -- thanks for calling our attention to this. We'll correct this
          > for NetLogo 1.2.
          >
          > ==
          > Seth Tisue / seth@... / (847) 467-2814
          > lead developer, NetLogo http://ccl.northwestern.edu/netlogo/
          > Center for Connected Learning and Computer-Based Modeling School of
          > Education and Social Policy / Department of Computer Science
          > Northwestern University
          >
          >
          > To unsubscribe from this group, send an email to:
          > netlogo-users-unsubscribe@yahoogroups.com
          >
          >
          >
          > Your use of Yahoo! Groups is subject to
          > http://docs.yahoo.com/info/terms/
          >
          >
          >
          > To unsubscribe from this group, send an email to:
          > netlogo-users-unsubscribe@yahoogroups.com
          >
          >
          >
          > Your use of Yahoo! Groups is subject to
          > http://docs.yahoo.com/info/terms/



          To unsubscribe from this group, send an email to:
          netlogo-users-unsubscribe@yahoogroups.com



          Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
        • Nitin Raje
          Hi Well, I am also a new user and I haven t really checked if this would work.... It seems that the problem might be in your trade routine. It is not clear
          Message 4 of 8 , Nov 7, 2002
            Hi

            Well, I am also a new user and I haven't really
            checked if this would work....

            It seems that the problem might be in your 'trade'
            routine. It is not clear if the instructions are
            addressed to the buyer breed or the seller breed.

            Nitin

            --- "Ledesma, Rodolfo" <rledesma@...>
            wrote:
            > Youjiang,
            >
            > Hi.
            >
            > Thanks for the encouraging note. Right now the model
            > doesn't work because I
            > don't know if the code is right. When a buyer-turtle
            > meets up with a
            > seller-turtle and the buye-turtle's buying-price is
            > above the
            > seller-turtle's selling price or if there is at
            > least a match, the color of
            > the seller-turtle don't seem to change.
            >
            > Best,
            >
            > Rudy
            >
            > -----Original Message-----
            > From: Cheng Youjiang
            > [mailto:chengyou@...]
            > Sent: Wednesday, November 06, 2002 9:13 PM
            > To: rledesma@...
            > Cc: netlogo-users@yahoogroups.com
            > Subject: Re: [netlogo-users] Model Needing Help
            >
            >
            > Hi Rudy,
            >
            > I'm a new user too. I tried and created the attached
            > model. Does it satisfy
            > your requirements?
            >
            > Regards,
            > Youjiang
            >
            > > Hi.
            > >
            > > I'm a new user of Netlogo and I'm struggling with
            > my first model. My
            > > code is shown below. I would appreciate it if
            > someone can help me do
            > > it right.
            > >
            > > I'm trying to construct a simple model of
            > interacting buyers and
            > > sellers, both agents equipped with minimal rules,
            > similar to the one
            > > described by Pietro Terna (JASS, 1998;
            > > http://jasss.soc.surrey.ac.uk/1/2/4.html).
            > Essentially, I'd like to do
            > > an adaptation if possible of his model into
            > Netlogo.
            > >
            > > I'm starting with 10 buyers and 10 sellers for
            > now, meaning two types
            > > of agents. My plan is for a seller to initially
            > decide on a range of
            > > prices to sell a pretend good. The buyer on the
            > other hand offers to
            > > the seller a price it wants to buy the pretend
            > good.
            > >
            > > At every simulation or tick, buyers start looking
            > for a seller of the
            > > pretend good who I would like to remain stationary
            > while the buyers
            > > roam around randomly. Thus, the matching of a
            > buyer with a seller is
            > > random, if it takes place at all during a tick.
            > >
            > > An exchange occurs if the price asked by the
            > seller is lower than the
            > > level fixed by the buyer. (If I get past the
            > matching part of the
            > > coding, my plan is for a buyer who has not had an
            > exchange, say, in
            > > the past couple of ticks, to raise its offer
            > price. Conversely, if a
            > > seller has not had an exchange in the past couple
            > of ticks, it lowers
            > > its asking price.)
            > >
            > > At each time t (tick) I'd like each agent to
            > increase its transaction
            > > counter by 1 unit if it makes a trade and decrease
            > it by 1 unit if it
            > > doesn't trade.
            > >
            > > Below is my attempt at programming in NetLogo. I
            > would appreciate any
            > > help you can send my way.
            > >
            > > Thanks.
            > >
            > > Rudy Ledesma
            > > Marian College
            > > Fond du Lac, WI 543935
            > > 920-923-8149
            > >
            > > ---------------------------------------------
            > >
            > > globals [ clock ]
            > >
            > > breeds [ buyer seller ]
            > >
            > > turtles-own [ buying-price selling-price ]
            > >
            > > to setup
            > > ca
            > > initialize-variables
            > > create-buyer number
            > > ask buyer [ set color red ]
            > > ask buyer [ fd random screen-edge-y ]
            > > create-seller 20
            > > ask seller [ set color white ]
            > > ask seller [ fd random screen-edge-x ]
            > > end
            > >
            > > to go
            > > ask turtles [ trade ]
            > > ask buyer [
            > > fd 1
            > > rt random 360
            > > lt random 360
            > > wait .30
            > > buy
            > > ]
            > > ask seller [
            > > sell
            > > ]
            > > end
            > >
            > > to initialize-variables
            > > end
            > >
            > > to buy
            > > set buying-price 5
            > > search-for-seller
            > > end
            > >
            > >
            > > to sell
            > > set selling-price random 10
            > > end
            > >
            > > to search-for-seller
            > > ask turtles in-radius 0 with [ selling-price =
            > 4 ] [ set color
            > > green ] end
            > >
            > >
            > > to trade
            > > if(buying-price > selling-price) [ set color
            > turquoise ] end
            > >
            > >
            >
            ------------------------------------------------------------------
            > >
            > >
            > >
            > > -----Original Message-----
            > > From: Seth Tisue [mailto:seth@...]
            > > Sent: Monday, October 14, 2002 5:40 PM
            > > To: netlogo-users@yahoogroups.com
            > > Subject: Re: [netlogo-users] Heading predefined
            > variable
            > >
            > >
            > >>>>>> "Mitch" == Mitch Quinn
            > <mitchquinn@...> writes:
            > >
            > > Mitch> I'm surprised though that all of the other
            > variables Mitch>
            > > are explained in the user manual. Was 'heading'
            > just Mitch>
            > > forgotten?
            > >
            > > Yes -- thanks for calling our attention to this.
            > We'll correct this
            > > for NetLogo 1.2.
            > >
            > > ==
            > > Seth Tisue / seth@... / (847) 467-2814
            > > lead developer, NetLogo
            > http://ccl.northwestern.edu/netlogo/
            > > Center for Connected Learning and Computer-Based
            > Modeling School of
            > > Education and Social Policy / Department of
            > Computer Science
            > > Northwestern University
            > >
            > >
            > > To unsubscribe from this group, send an email to:
            > > netlogo-users-unsubscribe@yahoogroups.com
            > >
            > >
            > >
            > > Your use of Yahoo! Groups is subject to
            > > http://docs.yahoo.com/info/terms/
            > >
            >
            === message truncated ===


            __________________________________________________
            Do you Yahoo!?
            U2 on LAUNCH - Exclusive greatest hits videos
            http://launch.yahoo.com/u2
          • Youjiang
            Hello Rudy, I believe your computer is too fast, that s why the changing of colour cannot be seen when a match is found. I ve added a wait-delay to slow it
            Message 5 of 8 , Nov 7, 2002
              Hello Rudy,

              I believe your computer is too fast, that's why the changing of colour
              cannot be seen when a match is found. I've added a wait-delay to slow it
              down.

              As for whether the model is accurate, I'm also not sure. But I've included
              the following changes:
              1) Replaced Idle counter with Transaction counter such that
              - Every turn will inc one if traded else dec one, even if no trader
              within trade radius
              - If Transaction counter < - React threshold, buyer inc price and seller
              dec price
              - If Transaction counter > React threshold, buyer dec price and seller
              inc price
              2) Buyer/seller will seek the best offer price within trade radius

              Are the results as expected?

              Nevertheless, Netlogo is fun!

              :)

              Regards,
              Youjiang
              ----- Original Message -----
              From: "Ledesma, Rodolfo" <rledesma@...>
              To: <netlogo-users@yahoogroups.com>
              Sent: Thursday, November 07, 2002 11:19 PM
              Subject: RE: [netlogo-users] Model Needing Help


              > Youjiang,
              >
              > Hi.
              >
              > Thanks for the encouraging note. Right now the model doesn't work because
              I
              > don't know if the code is right. When a buyer-turtle meets up with a
              > seller-turtle and the buye-turtle's buying-price is above the
              > seller-turtle's selling price or if there is at least a match, the color
              of
              > the seller-turtle don't seem to change.
              >
              > Best,
              >
              > Rudy
              >
              > -----Original Message-----
              > From: Cheng Youjiang [mailto:chengyou@...]
              > Sent: Wednesday, November 06, 2002 9:13 PM
              > To: rledesma@...
              > Cc: netlogo-users@yahoogroups.com
              > Subject: Re: [netlogo-users] Model Needing Help
              >
              >
              > Hi Rudy,
              >
              > I'm a new user too. I tried and created the attached model. Does it
              satisfy
              > your requirements?
              >
              > Regards,
              > Youjiang
              >
              > > Hi.
              > >
              > > I'm a new user of Netlogo and I'm struggling with my first model. My
              > > code is shown below. I would appreciate it if someone can help me do
              > > it right.
              > >
              > > I'm trying to construct a simple model of interacting buyers and
              > > sellers, both agents equipped with minimal rules, similar to the one
              > > described by Pietro Terna (JASS, 1998;
              > > http://jasss.soc.surrey.ac.uk/1/2/4.html). Essentially, I'd like to do
              > > an adaptation if possible of his model into Netlogo.
              > >
              > > I'm starting with 10 buyers and 10 sellers for now, meaning two types
              > > of agents. My plan is for a seller to initially decide on a range of
              > > prices to sell a pretend good. The buyer on the other hand offers to
              > > the seller a price it wants to buy the pretend good.
              > >
              > > At every simulation or tick, buyers start looking for a seller of the
              > > pretend good who I would like to remain stationary while the buyers
              > > roam around randomly. Thus, the matching of a buyer with a seller is
              > > random, if it takes place at all during a tick.
              > >
              > > An exchange occurs if the price asked by the seller is lower than the
              > > level fixed by the buyer. (If I get past the matching part of the
              > > coding, my plan is for a buyer who has not had an exchange, say, in
              > > the past couple of ticks, to raise its offer price. Conversely, if a
              > > seller has not had an exchange in the past couple of ticks, it lowers
              > > its asking price.)
              > >
              > > At each time t (tick) I'd like each agent to increase its transaction
              > > counter by 1 unit if it makes a trade and decrease it by 1 unit if it
              > > doesn't trade.
              > >
              > > Below is my attempt at programming in NetLogo. I would appreciate any
              > > help you can send my way.
              > >
              > > Thanks.
              > >
              > > Rudy Ledesma
              > > Marian College
              > > Fond du Lac, WI 543935
              > > 920-923-8149
              > >
              > > ---------------------------------------------
              > >
              > > globals [ clock ]
              > >
              > > breeds [ buyer seller ]
              > >
              > > turtles-own [ buying-price selling-price ]
              > >
              > > to setup
              > > ca
              > > initialize-variables
              > > create-buyer number
              > > ask buyer [ set color red ]
              > > ask buyer [ fd random screen-edge-y ]
              > > create-seller 20
              > > ask seller [ set color white ]
              > > ask seller [ fd random screen-edge-x ]
              > > end
              > >
              > > to go
              > > ask turtles [ trade ]
              > > ask buyer [
              > > fd 1
              > > rt random 360
              > > lt random 360
              > > wait .30
              > > buy
              > > ]
              > > ask seller [
              > > sell
              > > ]
              > > end
              > >
              > > to initialize-variables
              > > end
              > >
              > > to buy
              > > set buying-price 5
              > > search-for-seller
              > > end
              > >
              > >
              > > to sell
              > > set selling-price random 10
              > > end
              > >
              > > to search-for-seller
              > > ask turtles in-radius 0 with [ selling-price = 4 ] [ set color
              > > green ] end
              > >
              > >
              > > to trade
              > > if(buying-price > selling-price) [ set color turquoise ] end
            • Ledesma, Rodolfo
              Youjiang, Thank you so much. Let me try that out and see what happens. You re giving me some nice ideas. Rudy ... From: Youjiang
              Message 6 of 8 , Nov 8, 2002
                Youjiang,

                Thank you so much.

                Let me try that out and see what happens.

                You're giving me some nice ideas.

                Rudy

                -----Original Message-----
                From: Youjiang [mailto:chengyou@...]
                Sent: Thursday, November 07, 2002 3:59 PM
                To: netlogo-users@yahoogroups.com
                Subject: Re: [netlogo-users] Model Needing Help


                Hello Rudy,

                I believe your computer is too fast, that's why the changing of colour
                cannot be seen when a match is found. I've added a wait-delay to slow it
                down.

                As for whether the model is accurate, I'm also not sure. But I've included
                the following changes:
                1) Replaced Idle counter with Transaction counter such that
                - Every turn will inc one if traded else dec one, even if no trader
                within trade radius
                - If Transaction counter < - React threshold, buyer inc price and seller
                dec price
                - If Transaction counter > React threshold, buyer dec price and seller
                inc price
                2) Buyer/seller will seek the best offer price within trade radius

                Are the results as expected?

                Nevertheless, Netlogo is fun!

                :)

                Regards,
                Youjiang
                ----- Original Message -----
                From: "Ledesma, Rodolfo" <rledesma@...>
                To: <netlogo-users@yahoogroups.com>
                Sent: Thursday, November 07, 2002 11:19 PM
                Subject: RE: [netlogo-users] Model Needing Help


                > Youjiang,
                >
                > Hi.
                >
                > Thanks for the encouraging note. Right now the model doesn't work
                > because
                I
                > don't know if the code is right. When a buyer-turtle meets up with a
                > seller-turtle and the buye-turtle's buying-price is above the
                > seller-turtle's selling price or if there is at least a match, the
                > color
                of
                > the seller-turtle don't seem to change.
                >
                > Best,
                >
                > Rudy
                >
                > -----Original Message-----
                > From: Cheng Youjiang [mailto:chengyou@...]
                > Sent: Wednesday, November 06, 2002 9:13 PM
                > To: rledesma@...
                > Cc: netlogo-users@yahoogroups.com
                > Subject: Re: [netlogo-users] Model Needing Help
                >
                >
                > Hi Rudy,
                >
                > I'm a new user too. I tried and created the attached model. Does it
                satisfy
                > your requirements?
                >
                > Regards,
                > Youjiang
                >
                > > Hi.
                > >
                > > I'm a new user of Netlogo and I'm struggling with my first model. My
                > > code is shown below. I would appreciate it if someone can help me do
                > > it right.
                > >
                > > I'm trying to construct a simple model of interacting buyers and
                > > sellers, both agents equipped with minimal rules, similar to the one
                > > described by Pietro Terna (JASS, 1998;
                > > http://jasss.soc.surrey.ac.uk/1/2/4.html). Essentially, I'd like to
                > > do an adaptation if possible of his model into Netlogo.
                > >
                > > I'm starting with 10 buyers and 10 sellers for now, meaning two
                > > types of agents. My plan is for a seller to initially decide on a
                > > range of prices to sell a pretend good. The buyer on the other hand
                > > offers to the seller a price it wants to buy the pretend good.
                > >
                > > At every simulation or tick, buyers start looking for a seller of
                > > the pretend good who I would like to remain stationary while the
                > > buyers roam around randomly. Thus, the matching of a buyer with a
                > > seller is random, if it takes place at all during a tick.
                > >
                > > An exchange occurs if the price asked by the seller is lower than
                > > the level fixed by the buyer. (If I get past the matching part of
                > > the coding, my plan is for a buyer who has not had an exchange, say,
                > > in the past couple of ticks, to raise its offer price. Conversely,
                > > if a seller has not had an exchange in the past couple of ticks, it
                > > lowers its asking price.)
                > >
                > > At each time t (tick) I'd like each agent to increase its
                > > transaction counter by 1 unit if it makes a trade and decrease it by
                > > 1 unit if it doesn't trade.
                > >
                > > Below is my attempt at programming in NetLogo. I would appreciate
                > > any help you can send my way.
                > >
                > > Thanks.
                > >
                > > Rudy Ledesma
                > > Marian College
                > > Fond du Lac, WI 543935
                > > 920-923-8149
                > >
                > > ---------------------------------------------
                > >
                > > globals [ clock ]
                > >
                > > breeds [ buyer seller ]
                > >
                > > turtles-own [ buying-price selling-price ]
                > >
                > > to setup
                > > ca
                > > initialize-variables
                > > create-buyer number
                > > ask buyer [ set color red ]
                > > ask buyer [ fd random screen-edge-y ]
                > > create-seller 20
                > > ask seller [ set color white ]
                > > ask seller [ fd random screen-edge-x ]
                > > end
                > >
                > > to go
                > > ask turtles [ trade ]
                > > ask buyer [
                > > fd 1
                > > rt random 360
                > > lt random 360
                > > wait .30
                > > buy
                > > ]
                > > ask seller [
                > > sell
                > > ]
                > > end
                > >
                > > to initialize-variables
                > > end
                > >
                > > to buy
                > > set buying-price 5
                > > search-for-seller
                > > end
                > >
                > >
                > > to sell
                > > set selling-price random 10
                > > end
                > >
                > > to search-for-seller
                > > ask turtles in-radius 0 with [ selling-price = 4 ] [ set color
                > > green ] end
                > >
                > >
                > > to trade
                > > if(buying-price > selling-price) [ set color turquoise ] end


                To unsubscribe from this group, send an email to:
                netlogo-users-unsubscribe@yahoogroups.com



                Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
              • Ledesma, Rodolfo
                Youjiang, Wow! You ve done so much to improve it. I just had a chance to open your attachment and it s so much more impoved than what I have. You re modest but
                Message 7 of 8 , Nov 8, 2002
                  Youjiang,

                  Wow!

                  You've done so much to improve it.

                  I just had a chance to open your attachment and it's so much more impoved
                  than what I have. You're modest but I think you're far ahead on NetLogo
                  already.

                  I'll try it out and let you know.

                  Thanks again.

                  Rudy

                  -----Original Message-----
                  From: Youjiang [mailto:chengyou@...]
                  Sent: Thursday, November 07, 2002 3:59 PM
                  To: netlogo-users@yahoogroups.com
                  Subject: Re: [netlogo-users] Model Needing Help


                  Hello Rudy,

                  I believe your computer is too fast, that's why the changing of colour
                  cannot be seen when a match is found. I've added a wait-delay to slow it
                  down.

                  As for whether the model is accurate, I'm also not sure. But I've included
                  the following changes:
                  1) Replaced Idle counter with Transaction counter such that
                  - Every turn will inc one if traded else dec one, even if no trader
                  within trade radius
                  - If Transaction counter < - React threshold, buyer inc price and seller
                  dec price
                  - If Transaction counter > React threshold, buyer dec price and seller
                  inc price
                  2) Buyer/seller will seek the best offer price within trade radius

                  Are the results as expected?

                  Nevertheless, Netlogo is fun!

                  :)

                  Regards,
                  Youjiang
                  ----- Original Message -----
                  From: "Ledesma, Rodolfo" <rledesma@...>
                  To: <netlogo-users@yahoogroups.com>
                  Sent: Thursday, November 07, 2002 11:19 PM
                  Subject: RE: [netlogo-users] Model Needing Help


                  > Youjiang,
                  >
                  > Hi.
                  >
                  > Thanks for the encouraging note. Right now the model doesn't work
                  > because
                  I
                  > don't know if the code is right. When a buyer-turtle meets up with a
                  > seller-turtle and the buye-turtle's buying-price is above the
                  > seller-turtle's selling price or if there is at least a match, the
                  > color
                  of
                  > the seller-turtle don't seem to change.
                  >
                  > Best,
                  >
                  > Rudy
                  >
                  > -----Original Message-----
                  > From: Cheng Youjiang [mailto:chengyou@...]
                  > Sent: Wednesday, November 06, 2002 9:13 PM
                  > To: rledesma@...
                  > Cc: netlogo-users@yahoogroups.com
                  > Subject: Re: [netlogo-users] Model Needing Help
                  >
                  >
                  > Hi Rudy,
                  >
                  > I'm a new user too. I tried and created the attached model. Does it
                  satisfy
                  > your requirements?
                  >
                  > Regards,
                  > Youjiang
                  >
                  > > Hi.
                  > >
                  > > I'm a new user of Netlogo and I'm struggling with my first model. My
                  > > code is shown below. I would appreciate it if someone can help me do
                  > > it right.
                  > >
                  > > I'm trying to construct a simple model of interacting buyers and
                  > > sellers, both agents equipped with minimal rules, similar to the one
                  > > described by Pietro Terna (JASS, 1998;
                  > > http://jasss.soc.surrey.ac.uk/1/2/4.html). Essentially, I'd like to
                  > > do an adaptation if possible of his model into Netlogo.
                  > >
                  > > I'm starting with 10 buyers and 10 sellers for now, meaning two
                  > > types of agents. My plan is for a seller to initially decide on a
                  > > range of prices to sell a pretend good. The buyer on the other hand
                  > > offers to the seller a price it wants to buy the pretend good.
                  > >
                  > > At every simulation or tick, buyers start looking for a seller of
                  > > the pretend good who I would like to remain stationary while the
                  > > buyers roam around randomly. Thus, the matching of a buyer with a
                  > > seller is random, if it takes place at all during a tick.
                  > >
                  > > An exchange occurs if the price asked by the seller is lower than
                  > > the level fixed by the buyer. (If I get past the matching part of
                  > > the coding, my plan is for a buyer who has not had an exchange, say,
                  > > in the past couple of ticks, to raise its offer price. Conversely,
                  > > if a seller has not had an exchange in the past couple of ticks, it
                  > > lowers its asking price.)
                  > >
                  > > At each time t (tick) I'd like each agent to increase its
                  > > transaction counter by 1 unit if it makes a trade and decrease it by
                  > > 1 unit if it doesn't trade.
                  > >
                  > > Below is my attempt at programming in NetLogo. I would appreciate
                  > > any help you can send my way.
                  > >
                  > > Thanks.
                  > >
                  > > Rudy Ledesma
                  > > Marian College
                  > > Fond du Lac, WI 543935
                  > > 920-923-8149
                  > >
                  > > ---------------------------------------------
                  > >
                  > > globals [ clock ]
                  > >
                  > > breeds [ buyer seller ]
                  > >
                  > > turtles-own [ buying-price selling-price ]
                  > >
                  > > to setup
                  > > ca
                  > > initialize-variables
                  > > create-buyer number
                  > > ask buyer [ set color red ]
                  > > ask buyer [ fd random screen-edge-y ]
                  > > create-seller 20
                  > > ask seller [ set color white ]
                  > > ask seller [ fd random screen-edge-x ]
                  > > end
                  > >
                  > > to go
                  > > ask turtles [ trade ]
                  > > ask buyer [
                  > > fd 1
                  > > rt random 360
                  > > lt random 360
                  > > wait .30
                  > > buy
                  > > ]
                  > > ask seller [
                  > > sell
                  > > ]
                  > > end
                  > >
                  > > to initialize-variables
                  > > end
                  > >
                  > > to buy
                  > > set buying-price 5
                  > > search-for-seller
                  > > end
                  > >
                  > >
                  > > to sell
                  > > set selling-price random 10
                  > > end
                  > >
                  > > to search-for-seller
                  > > ask turtles in-radius 0 with [ selling-price = 4 ] [ set color
                  > > green ] end
                  > >
                  > >
                  > > to trade
                  > > if(buying-price > selling-price) [ set color turquoise ] end


                  To unsubscribe from this group, send an email to:
                  netlogo-users-unsubscribe@yahoogroups.com



                  Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
                • balaganesheho
                  Dear Sir, My name is Bala Ganesh. I am taking a course on netlogo and was hoping if you could be so kind as to send me one of your netlogo models projects
                  Message 8 of 8 , Oct 9, 2003
                    Dear Sir,
                    My name is Bala Ganesh. I am taking a course on netlogo and was
                    hoping if you could be so kind as to send me one of your netlogo
                    models projects complete with description. Thank you very much.


                    --- In netlogo-users@yahoogroups.com, Nitin Raje
                    <nitin_raje1418@y...> wrote:
                    > Hi
                    >
                    > Well, I am also a new user and I haven't really
                    > checked if this would work....
                    >
                    > It seems that the problem might be in your 'trade'
                    > routine. It is not clear if the instructions are
                    > addressed to the buyer breed or the seller breed.
                    >
                    > Nitin
                    >
                    > --- "Ledesma, Rodolfo" <rledesma@m...>
                    > wrote:
                    > > Youjiang,
                    > >
                    > > Hi.
                    > >
                    > > Thanks for the encouraging note. Right now the model
                    > > doesn't work because I
                    > > don't know if the code is right. When a buyer-turtle
                    > > meets up with a
                    > > seller-turtle and the buye-turtle's buying-price is
                    > > above the
                    > > seller-turtle's selling price or if there is at
                    > > least a match, the color of
                    > > the seller-turtle don't seem to change.
                    > >
                    > > Best,
                    > >
                    > > Rudy
                    > >
                    > > -----Original Message-----
                    > > From: Cheng Youjiang
                    > > [mailto:chengyou@c...]
                    > > Sent: Wednesday, November 06, 2002 9:13 PM
                    > > To: rledesma@m...
                    > > Cc: netlogo-users@yahoogroups.com
                    > > Subject: Re: [netlogo-users] Model Needing Help
                    > >
                    > >
                    > > Hi Rudy,
                    > >
                    > > I'm a new user too. I tried and created the attached
                    > > model. Does it satisfy
                    > > your requirements?
                    > >
                    > > Regards,
                    > > Youjiang
                    > >
                    > > > Hi.
                    > > >
                    > > > I'm a new user of Netlogo and I'm struggling with
                    > > my first model. My
                    > > > code is shown below. I would appreciate it if
                    > > someone can help me do
                    > > > it right.
                    > > >
                    > > > I'm trying to construct a simple model of
                    > > interacting buyers and
                    > > > sellers, both agents equipped with minimal rules,
                    > > similar to the one
                    > > > described by Pietro Terna (JASS, 1998;
                    > > > http://jasss.soc.surrey.ac.uk/1/2/4.html).
                    > > Essentially, I'd like to do
                    > > > an adaptation if possible of his model into
                    > > Netlogo.
                    > > >
                    > > > I'm starting with 10 buyers and 10 sellers for
                    > > now, meaning two types
                    > > > of agents. My plan is for a seller to initially
                    > > decide on a range of
                    > > > prices to sell a pretend good. The buyer on the
                    > > other hand offers to
                    > > > the seller a price it wants to buy the pretend
                    > > good.
                    > > >
                    > > > At every simulation or tick, buyers start looking
                    > > for a seller of the
                    > > > pretend good who I would like to remain stationary
                    > > while the buyers
                    > > > roam around randomly. Thus, the matching of a
                    > > buyer with a seller is
                    > > > random, if it takes place at all during a tick.
                    > > >
                    > > > An exchange occurs if the price asked by the
                    > > seller is lower than the
                    > > > level fixed by the buyer. (If I get past the
                    > > matching part of the
                    > > > coding, my plan is for a buyer who has not had an
                    > > exchange, say, in
                    > > > the past couple of ticks, to raise its offer
                    > > price. Conversely, if a
                    > > > seller has not had an exchange in the past couple
                    > > of ticks, it lowers
                    > > > its asking price.)
                    > > >
                    > > > At each time t (tick) I'd like each agent to
                    > > increase its transaction
                    > > > counter by 1 unit if it makes a trade and decrease
                    > > it by 1 unit if it
                    > > > doesn't trade.
                    > > >
                    > > > Below is my attempt at programming in NetLogo. I
                    > > would appreciate any
                    > > > help you can send my way.
                    > > >
                    > > > Thanks.
                    > > >
                    > > > Rudy Ledesma
                    > > > Marian College
                    > > > Fond du Lac, WI 543935
                    > > > 920-923-8149
                    > > >
                    > > > ---------------------------------------------
                    > > >
                    > > > globals [ clock ]
                    > > >
                    > > > breeds [ buyer seller ]
                    > > >
                    > > > turtles-own [ buying-price selling-price ]
                    > > >
                    > > > to setup
                    > > > ca
                    > > > initialize-variables
                    > > > create-buyer number
                    > > > ask buyer [ set color red ]
                    > > > ask buyer [ fd random screen-edge-y ]
                    > > > create-seller 20
                    > > > ask seller [ set color white ]
                    > > > ask seller [ fd random screen-edge-x ]
                    > > > end
                    > > >
                    > > > to go
                    > > > ask turtles [ trade ]
                    > > > ask buyer [
                    > > > fd 1
                    > > > rt random 360
                    > > > lt random 360
                    > > > wait .30
                    > > > buy
                    > > > ]
                    > > > ask seller [
                    > > > sell
                    > > > ]
                    > > > end
                    > > >
                    > > > to initialize-variables
                    > > > end
                    > > >
                    > > > to buy
                    > > > set buying-price 5
                    > > > search-for-seller
                    > > > end
                    > > >
                    > > >
                    > > > to sell
                    > > > set selling-price random 10
                    > > > end
                    > > >
                    > > > to search-for-seller
                    > > > ask turtles in-radius 0 with [ selling-price =
                    > > 4 ] [ set color
                    > > > green ] end
                    > > >
                    > > >
                    > > > to trade
                    > > > if(buying-price > selling-price) [ set color
                    > > turquoise ] end
                    > > >
                    > > >
                    > >
                    > ------------------------------------------------------------------
                    > > >
                    > > >
                    > > >
                    > > > -----Original Message-----
                    > > > From: Seth Tisue [mailto:seth@t...]
                    > > > Sent: Monday, October 14, 2002 5:40 PM
                    > > > To: netlogo-users@yahoogroups.com
                    > > > Subject: Re: [netlogo-users] Heading predefined
                    > > variable
                    > > >
                    > > >
                    > > >>>>>> "Mitch" == Mitch Quinn
                    > > <mitchquinn@s...> writes:
                    > > >
                    > > > Mitch> I'm surprised though that all of the other
                    > > variables Mitch>
                    > > > are explained in the user manual. Was 'heading'
                    > > just Mitch>
                    > > > forgotten?
                    > > >
                    > > > Yes -- thanks for calling our attention to this.
                    > > We'll correct this
                    > > > for NetLogo 1.2.
                    > > >
                    > > > ==
                    > > > Seth Tisue / seth@t... / (847) 467-2814
                    > > > lead developer, NetLogo
                    > > http://ccl.northwestern.edu/netlogo/
                    > > > Center for Connected Learning and Computer-Based
                    > > Modeling School of
                    > > > Education and Social Policy / Department of
                    > > Computer Science
                    > > > Northwestern University
                    > > >
                    > > >
                    > > > To unsubscribe from this group, send an email to:
                    > > > netlogo-users-unsubscribe@yahoogroups.com
                    > > >
                    > > >
                    > > >
                    > > > Your use of Yahoo! Groups is subject to
                    > > > http://docs.yahoo.com/info/terms/
                    > > >
                    > >
                    > === message truncated ===
                    >
                    >
                    > __________________________________________________
                    > Do you Yahoo!?
                    > U2 on LAUNCH - Exclusive greatest hits videos
                    > http://launch.yahoo.com/u2
                  Your message has been successfully submitted and would be delivered to recipients shortly.