Morgen alleWarum stoppt der Lukenanschlag nach einiger Zeit?
Nach meinem Modell der Bearbeitung durch eine zufällige Spawnrate Zugabe:
to migrate
if random-float 100 < random-spawn-rate
[create-turtles 2 [rt random-float 360 fd 1]]
end
ich das Problem bekommen, dass nach einer Art von Schildkröten (die Boote) aussterben, auch ihre zufälligen Schraffur scheint Aussterben? Ich habe versucht, andere Wege, aber nichts wirklich funktioniert
helfen Bitte mich danke
Voll Code:
breed [fish a-fish]
breed [boats boat]
boats-own [profit]
to setup
clear-all
ask patches [set pcolor blue]
set-default-shape fish "fish"
create-fish initial-number-fish
[
set color grey
set size 1.0
setxy random-xcor random-ycor
]
set-default-shape boats "boat"
create-boats initial-number-boats
[
set color black
set size 1.5
set profit random (1 * profit-per-fish)
setxy random-xcor random-ycor
]
reset-ticks
end
to go
if not any? turtles [stop]
ask fish
[
move
fish-reproduce
]
ask boats
[
move-boats
catch-fish
death
reproduce-boats
migrate
]
tick
end
to move
rt random 50
lt random 50
fd 1
end
to fish-reproduce
if random-float 100 < fish-growth
[hatch 1 [rt random-float 360 fd 1]]
end
to move-boats
rt random 50
lt random 50
fd 1
set profit profit - 0.1
end
to catch-fish
let prey one-of fish-here
if prey != nobody
[ask prey [die]
set profit profit + profit-per-fish]
end
to death
if profit < 0 [die]
end
to reproduce-boats
if profit > 1
[
set profit (profit/2)
hatch 1 [rt random-float 360 fd 1]]
end
to migrate
if random-float 100 < random-spawn-rate
[create-turtles 2 [rt random-float 360 fd 1]]
end
Hatten Sie immer noch Fische, als die Bootserstellung aufhörte? – JenB
ja es sind immer noch fische, aber das boot popullation stirbt aus – bRam
ich habe es funktioniert danke :) – bRam