gama-platform / gama.old

Main repository for developing the 1.x versions of GAMA
GNU General Public License v3.0
304 stars 99 forks source link

Label appears behind shape #3826

Closed Schlickfrau closed 1 year ago

Schlickfrau commented 1 year ago

Good evening , As a beginner in using GAMA and coding, I came across an issue that I was kindly asked to forward, because it might be a bug :lady_beetle:. Please see my attached remarks and my ful code with remarks, if further questions come up Kindest regards Andrea

Steps to reproduce

  1. aspect is defined in species order: first shape then string
    aspect energy {
    draw square (2) color: #black;
    draw string(energy with_precision 0) size: 5  color: #black font: font("Helvetica", 20 , #bold);
    }
  2. aspect is displayed in output of experiment
    display svannah_labelled_energy type: opengl {
    species lions aspect: energy;
    species zebras aspect: energy;
    grid vegetation_cell border: #black transparency: 0.5;  
    }
  3. grafik

4.

no difference if order is reverse


aspect energy {
    draw string(energy with_precision 0) size: 5  color: #black font: font("Helvetica", 20 , #bold);
    draw square (2) color: #black;
    }
5. 
![grafik](https://github.com/gama-platform/gama/assets/111689536/0b07b3ec-1a7f-471b-bde6-4b7cb346a0f1)

6. Complete Code 
``` ruby
/**
* Name: Lion eating Zebras
* Based on the internal empty template. 
* Author: Fusion of UNIGIS Spatial Simulation Lesson 7 + Predator Pray Model step 1 to 3
* modified by: A.Schlickmann
* date: 12.06.23
* Tags: grid, food, energy transfer, wander
*/

model LionsandZebras

global {

        float zebra_max_energy <- 500.0;
        float zebra_max_transfer <- 50.0;
        float zebra_energy_consum <- 5.0;
        init {
            create lions number:5 {
            age <- int(rnd(5));
            energy <- 100.0;
            }
            create zebras number: 10 {
                age <- int(rnd(5));
            }
        }
    }

species lions skills:[moving]{
    int age;
    float energy;

    list<zebras> my_zebras;

    reflex eatZebras{
        my_zebras <- zebras overlapping (self + circle(10));
        ask my_zebras{
            do die;
        }
    }

    aspect base {
        draw circle (2) color: #orange;
        }
    aspect energy {
        draw circle (2);
        draw string(energy with_precision 0) size: 2  color: #black;    
        }
    }

species zebras skills:[moving] {
    int age <- 0;
    // maximum energy a zebra can have
    float max_energy <- zebra_max_energy;
    // max energy a zebra can consume from vegetation per step
    float max_transfer <- zebra_max_transfer;
    // living energy of the zebra at each step
    float energy_consum <- zebra_energy_consum;

    // task: relate Zebra to the vegetation cell grid
    // new attribute my_cell of the type vegetation_cell
    // the init value: one_of the vegetation_cell.
    vegetation_cell my_cell <- one_of(vegetation_cell);

    // energy used by each zebra at each timestep to live
    float energy <- rnd(max_energy) update: energy - energy_consum max: max_energy;

    // locate Zebra onto a vegetation cell
    init{
        // zebra location equals location of vegetation cell(i.e. its centroid)
        location <- my_cell.location;
    }

    reflex moveAround{
        my_cell <- one_of(my_cell.neighbors2);
        location <- my_cell.location;
        write location;
        do wander amplitude:45.0 speed: 50.0;
    }

    reflex eat when: my_cell.food > 0 {
        // minimum value of the list of max transfer and my_cell.food.
        // if the my_cell.food is smaller than 50, only for example 25 will be transferred.
        float energy_transfer <- min([max_transfer, my_cell.food]);
        my_cell.food <- my_cell.food - energy_transfer;
        energy <- energy + energy_transfer;
        write energy;
    }   

    reflex die when: energy <= 0{
        write "i starved";
        do die;
    }

    reflex get_older {
        age <- age +1;
        if age > 15 {
            do die_of_age;
        }
    }

    action die_of_age {
    write "i am going to die!";
    do die;
    }

    aspect base {
    draw square (2) color: #black;
    }
    aspect energy {

        draw string(energy with_precision 0) size: 5  color: #black font: font("Helvetica", 20 , #bold);
        draw square (2) color: #black;
    }

}

grid vegetation_cell width: 50 height: 50 neighbors: 8{

    // max food a cell can contain
    float max_food <- 256.0;
    // food produced by cell at each step of simulation:
    float food_prod <- 2.0;
    // food displays the current quantity of food the cell can provide which will be increased each step of the simulation by food_prod
    float food <- rnd(255.0) max: max_food update: food+food_prod;
    // shades of green
    rgb color <- rgb(0, int(food), 0)
        update: rgb(0, int(food), 0);
    // variable neighbors10 for the vegetation_cell grid: contains for each vegetation cell to neighbors in the the distance of 10 m
    list<vegetation_cell> neighbors2 <-self neighbors_at 2;
}

experiment mySimulation type: gui{
    parameter "Zebra max energy: " var: zebra_max_energy category: "Zebra";
    parameter "Zebra max transfer: " var: zebra_max_transfer category: "Zebra";
    parameter "Zebra energy consum: " var: zebra_energy_consum category: "Zebra";

    output {
        display svannah_default type: opengl {
            grid vegetation_cell border: #black transparency: 0.5;
            species lions aspect: base;
            species zebras aspect: base;

        }
        display svannah_labelled_energy type: opengl {

                species lions aspect: energy;
                species zebras aspect: energy;
                grid vegetation_cell border: #black transparency: 0.5;  
        }
    }
}

Expected behavior

The label should be displayed in front of the shape?

Actual behavior

The label vanishes behind the shape

System and version

*** Date: Montag, 12. Juni 2023 um 17:43:41 Mitteleuropäische Sommerzeit

*** Platform Details:

*** System properties: applicationXMI=org.eclipse.ui.workbench/LegacyIDE.e4xmi clearPersistedState=true ds.delayed.keepInstances=true eclipse.application=msi.gama.application.GamaApplication eclipse.buildId=${build.id} eclipse.commands=-os win32 -ws win32 -arch x86_64 -showsplash -launcher C:\Program Files\Gama\Gama.exe -name Gama --launcher.library C:\Program Files\Gama\plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.2.400.v20211117-0650\eclipse_11602.dll -startup C:\Program Files\Gama\plugins/org.eclipse.equinox.launcher_1.6.400.v20210924-0641.jar --launcher.overrideVmargs -data @noDefault -vm C:\Program Files\Gama\./jdk/bin\server\jvm.dll eclipse.home.location=file:/C:/Program Files/Gama/ eclipse.launcher=C:\Program Files\Gama\Gama.exe eclipse.launcher.name=Gama eclipse.log.level=ERROR eclipse.p2.data.area=@config.dir/../p2 eclipse.p2.profile=DefaultProfile eclipse.product=msi.gama.application.product eclipse.startTime=1686580420726 eclipse.stateSaveDelayInterval=30000 eclipse.vm=C:\Program Files\Gama\./jdk/bin\server\jvm.dll eclipse.vmargs=-server -XX:+UseG1GC -XX:+UseStringDeduplication -Dorg.eclipse.swt.graphics.Resource.reportNonDisposed=false -Xms4096m -Xmx4096m -Xss128m -Xmn1024m -XX:+UseAdaptiveSizePolicy -XX:+OptimizeStringConcat -Dosgi.locking=none -Dosgi.checkConfiguration=false -Declipse.log.level=ERROR -Dorg.eclipse.ecf.provider.filetransfer.retrieve.retryAttempts=10 -Dorg.eclipse.ecf.provider.filetransfer.retrieve.closeTimeout=6000 -Dorg.eclipse.ecf.provider.filetransfer.retrieve.readTimeout=6000 -Denable_logging=true -Duse_global_preference_store=true -Duse_precise_autoscale=false -Dread_only=false -Duse_old_tabs=true -Duse_legacy_drawers=false -Duse_delayed_resize=false -Duse_native_opengl_window=true --add-opens=java.base/java.lang=ALL-UNNAMED --add-exports=java.base/java.lang=ALL-UNNAMED --add-exports=java.desktop/sun.awt=ALL-UNNAMED --add-exports=java.desktop/sun.java2d=ALL-UNNAMED -Dsun.java2d.uiScale.enabled=false -Dfile.encoding=UTF-8 -Djava.class.path=C:\Program Files\Gama\plugins/org.eclipse.equinox.launcher_1.6.400.v20210924-0641.jar enable_logging=true equinox.init.uuid=true equinox.use.ds=true file.encoding=UTF-8 file.separator=\ gosh.args=--nointeractive java.class.path=C:\Program Files\Gama\plugins/org.eclipse.equinox.launcher_1.6.400.v20210924-0641.jar java.class.version=61.0 java.home=C:\Program Files\Gama\jdk java.io.tmpdir=C:\Users\besitzer\AppData\Local\Temp\ java.library.path=C:\Program Files\Gama;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Users\besitzer\AppData\Local\Microsoft\WindowsApps;;. java.runtime.name=OpenJDK Runtime Environment java.runtime.version=17.0.3+7 java.specification.name=Java Platform API Specification java.specification.vendor=Oracle Corporation java.specification.version=17 java.vendor=Eclipse Adoptium java.vendor.url=https://adoptium.net/ java.vendor.url.bug=https://github.com/adoptium/adoptium-support/issues java.vendor.version=Temurin-17.0.3+7 java.version=17.0.3 java.version.date=2022-04-19 java.vm.compressedOopsMode=Zero based java.vm.info=mixed mode, sharing java.vm.name=OpenJDK 64-Bit Server VM java.vm.specification.name=Java Virtual Machine Specification java.vm.specification.vendor=Oracle Corporation java.vm.specification.version=17 java.vm.vendor=Eclipse Adoptium java.vm.version=17.0.3+7 jdk.debug=release jnlp.jogamp.tmp.cache.root=jln15499710191581578661 line.separator=

native.encoding=Cp1252 org.eclipse.ecf.provider.filetransfer.retrieve.closeTimeout=6000 org.eclipse.ecf.provider.filetransfer.retrieve.readTimeout=6000 org.eclipse.ecf.provider.filetransfer.retrieve.retryAttempts=10 org.eclipse.equinox.launcher.splash.location=C:\Users\besitzer.eclipse\306334380_win32_win32_x86_64\configuration\org.eclipse.equinox.launcher\msi.gama.application_1.8.2.202207220447\splash.bmp org.eclipse.equinox.simpleconfigurator.configUrl=file:org.eclipse.equinox.simpleconfigurator/bundles.info org.eclipse.swt.display.useSystemTheme=true org.eclipse.swt.graphics.Resource.reportNonDisposed=false org.eclipse.swt.internal.deviceZoom=100 org.osgi.framework.executionenvironment=OSGi/Minimum-1.0, OSGi/Minimum-1.1, OSGi/Minimum-1.2, JavaSE/compact1-1.8, JavaSE/compact2-1.8, JavaSE/compact3-1.8, JRE-1.1, J2SE-1.2, J2SE-1.3, J2SE-1.4, J2SE-1.5, JavaSE-1.6, JavaSE-1.7, JavaSE-1.8, JavaSE-9, JavaSE-10, JavaSE-11, JavaSE-12, JavaSE-13, JavaSE-14, JavaSE-15, JavaSE-16, JavaSE-17 org.osgi.framework.language=de org.osgi.framework.os.name=Windows10 org.osgi.framework.os.version=10.0.0 org.osgi.framework.processor=x86-64 org.osgi.framework.storage=C:\Users\besitzer.eclipse\306334380_win32_win32_x86_64\configuration org.osgi.framework.system.capabilities=osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0, 1.1, 1.2", osgi.ee; osgi.ee="JRE"; version:List="1.0, 1.1", osgi.ee; osgi.ee="JavaSE"; version:List="1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0",osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0",osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0",osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0" org.osgi.framework.system.packages=com.sun.jarsigner, com.sun.java.accessibility.util, com.sun.jdi, com.sun.jdi.connect, com.sun.jdi.connect.spi, com.sun.jdi.event, com.sun.jdi.request, com.sun.management, com.sun.net.httpserver, com.sun.net.httpserver.spi, com.sun.nio.file, com.sun.nio.sctp, com.sun.security.auth, com.sun.security.auth.callback, com.sun.security.auth.login, com.sun.security.auth.module, com.sun.security.jgss, com.sun.source.doctree, com.sun.source.tree, com.sun.source.util, com.sun.tools.attach, com.sun.tools.attach.spi, com.sun.tools.javac, com.sun.tools.jconsole, java.applet, java.awt, java.awt.color, java.awt.datatransfer, java.awt.desktop, java.awt.dnd, java.awt.event, java.awt.font, java.awt.geom, java.awt.im, java.awt.im.spi, java.awt.image, java.awt.image.renderable, java.awt.print, java.beans, java.beans.beancontext, java.io, java.lang, java.lang.annotation, java.lang.constant, java.lang.instrument, java.lang.invoke, java.lang.management, java.lang.module, java.lang.ref, java.lang.reflect, java.lang.runtime, java.math, java.net, java.net.http, java.net.spi, java.nio, java.nio.channels, java.nio.channels.spi, java.nio.charset, java.nio.charset.spi, java.nio.file, java.nio.file.attribute, java.nio.file.spi, java.rmi, java.rmi.dgc, java.rmi.registry, java.rmi.server, java.security, java.security.cert, java.security.interfaces, java.security.spec, java.sql, java.text, java.text.spi, java.time, java.time.chrono, java.time.format, java.time.temporal, java.time.zone, java.util, java.util.concurrent, java.util.concurrent.atomic, java.util.concurrent.locks, java.util.function, java.util.jar, java.util.logging, java.util.prefs, java.util.random, java.util.regex, java.util.spi, java.util.stream, java.util.zip, javax.accessibility, javax.annotation.processing, javax.crypto, javax.crypto.interfaces, javax.crypto.spec, javax.imageio, javax.imageio.event, javax.imageio.metadata, javax.imageio.plugins.bmp, javax.imageio.plugins.jpeg, javax.imageio.plugins.tiff, javax.imageio.spi, javax.imageio.stream, javax.lang.model, javax.lang.model.element, javax.lang.model.type, javax.lang.model.util, javax.management, javax.management.loading, javax.management.modelmbean, javax.management.monitor, javax.management.openmbean, javax.management.relation, javax.management.remote, javax.management.remote.rmi, javax.management.timer, javax.naming, javax.naming.directory, javax.naming.event, javax.naming.ldap, javax.naming.ldap.spi, javax.naming.spi, javax.net, javax.net.ssl, javax.print, javax.print.attribute, javax.print.attribute.standard, javax.print.event, javax.rmi.ssl, javax.script, javax.security.auth, javax.security.auth.callback, javax.security.auth.kerberos, javax.security.auth.login, javax.security.auth.spi, javax.security.auth.x500, javax.security.cert, javax.security.sasl, javax.smartcardio, javax.sound.midi, javax.sound.midi.spi, javax.sound.sampled, javax.sound.sampled.spi, javax.sql, javax.sql.rowset, javax.sql.rowset.serial, javax.sql.rowset.spi, javax.swing, javax.swing.border, javax.swing.colorchooser, javax.swing.event, javax.swing.filechooser, javax.swing.plaf, javax.swing.plaf.basic, javax.swing.plaf.metal, javax.swing.plaf.multi, javax.swing.plaf.nimbus, javax.swing.plaf.synth, javax.swing.table, javax.swing.text, javax.swing.text.html, javax.swing.text.html.parser, javax.swing.text.rtf, javax.swing.tree, javax.swing.undo, javax.tools, javax.transaction.xa, javax.xml, javax.xml.catalog, javax.xml.crypto, javax.xml.crypto.dom, javax.xml.crypto.dsig, javax.xml.crypto.dsig.dom, javax.xml.crypto.dsig.keyinfo, javax.xml.crypto.dsig.spec, javax.xml.datatype, javax.xml.namespace, javax.xml.parsers, javax.xml.stream, javax.xml.stream.events, javax.xml.stream.util, javax.xml.transform, javax.xml.transform.dom, javax.xml.transform.sax, javax.xml.transform.stax, javax.xml.transform.stream, javax.xml.validation, javax.xml.xpath, jdk.dynalink, jdk.dynalink.beans, jdk.dynalink.linker, jdk.dynalink.linker.support, jdk.dynalink.support, jdk.javadoc.doclet, jdk.jfr, jdk.jfr.consumer, jdk.jshell, jdk.jshell.execution, jdk.jshell.spi, jdk.jshell.tool, jdk.management.jfr, jdk.net, jdk.nio, jdk.nio.mapmode, jdk.security.jarsigner, jdk.swing.interop, netscape.javascript, org.ietf.jgss, org.w3c.dom, org.w3c.dom.bootstrap, org.w3c.dom.css, org.w3c.dom.events, org.w3c.dom.html, org.w3c.dom.ls, org.w3c.dom.ranges, org.w3c.dom.stylesheets, org.w3c.dom.traversal, org.w3c.dom.views, org.w3c.dom.xpath, org.xml.sax, org.xml.sax.ext, org.xml.sax.helpers, sun.misc, sun.reflect org.osgi.framework.uuid=865f4d7d-047b-44cb-a96d-496967ccaf04 org.osgi.framework.vendor=Eclipse org.osgi.framework.version=1.10.0 org.osgi.supports.framework.extension=true org.osgi.supports.framework.fragment=true org.osgi.supports.framework.requirebundle=true os.arch=amd64 os.name=Windows 10 os.version=10.0 osgi.arch=x86_64 osgi.bundles=reference:file:org.eclipse.osgi.compatibility.state_1.2.600.v20220207-1403.jar,reference:file:org.eclipse.equinox.common_3.16.0.v20220211-2322.jar@1:start,reference:file:org.eclipse.equinox.simpleconfigurator_1.4.0.v20210315-2228.jar@1:start osgi.bundles.defaultStartLevel=4 osgi.checkConfiguration=false osgi.compatibility.bootdelegation=true osgi.compatibility.bootdelegation.default=true osgi.configuration.area=file:/C:/Users/besitzer/.eclipse/306334380_win32_win32_x86_64/configuration/ osgi.framework=file:/c:/Program Files/Gama/plugins/org.eclipse.osgi_3.17.200.v20220215-2237.jar osgi.framework.extensions=reference:file:org.eclipse.osgi.compatibility.state_1.2.600.v20220207-1403.jar osgi.framework.shape=jar osgi.framework.useSystemProperties=true osgi.frameworkClassPath=., file:c:/Program Files/Gama/plugins/org.eclipse.osgi.compatibility.state_1.2.600.v20220207-1403.jar osgi.install.area=file:/C:/Program Files/Gama/ osgi.instance.area=file:/C:/Gama/ osgi.locking=none osgi.logfile=C:\Gama.metadata.log osgi.nl=de_DE osgi.os=win32 osgi.sharedConfiguration.area=file:/c:/Program Files/Gama/configuration/ osgi.splashLocation=C:\Users\besitzer.eclipse\306334380_win32_win32_x86_64\configuration\org.eclipse.equinox.launcher\msi.gama.application_1.8.2.202207220447\splash.bmp osgi.splashPath=platform:/base/plugins/msi.gama.application osgi.syspath=c:\Program Files\Gama\plugins osgi.tracefile=C:\Gama.metadata\trace.log osgi.ws=win32 path.separator=; read_only=false sun.arch.data.model=64 sun.awt.enableExtraMouseButtons=true sun.boot.library.path=C:\Program Files\Gama\jdk\bin sun.cpu.endian=little sun.cpu.isalist=amd64 sun.io.unicode.encoding=UnicodeLittle sun.java2d.uiScale.enabled=false sun.jnu.encoding=Cp1252 sun.management.compiler=HotSpot 64-Bit Tiered Compilers sun.os.patch.level= swt.autoScale=integer use_delayed_resize=false use_global_preference_store=true use_legacy_drawers=false use_native_opengl_window=true use_old_tabs=true use_precise_autoscale=false user.country=DE user.dir=C:\Program Files\Gama user.home=C:\Users\besitzer user.language=de user.name=besitzer user.script= user.timezone=Europe/Berlin user.variant= version=1.8.2

benoitgaudou commented 1 year ago

Dear, I am not completely sure what is your issue precisely.

Basically when you have :

aspect energy { draw square (2) color: #black; draw string(energy with_precision 0) size: 5 color: #blue font: font( "Helvetica", 20 , #bold); }

display svannah_default type: 2d { grid vegetation_cell border: #black transparency: 0.5; species lions aspect: energy; species zebras aspect: energy; } You get the following display, which looks without issue ?

[image: Capture d’écran 2023-06-13 à 09.21.25.png]

Cheers

Benoit

Le lun. 12 juin 2023 à 19:02, Schlickfrau @.***> a écrit :

Good evening , As a beginner in using GAMA and coding, I came across an issue that I was kindly asked to forward, because it might be a bug 🐞. Please see my attached remarks and my ful code with remarks, if further questions come up Kindest regards Andrea

Steps to reproduce

  1. aspect is defined in species

order: first shape then string

aspect energy { draw square (2) color: #black; draw string(energy with_precision 0) size: 5 color: #black font: font("Helvetica", 20 , #bold); }

  1. aspect is displayed in output of experiment

    display svannah_labelled_energy type: opengl { species lions aspect: energy; species zebras aspect: energy; grid vegetation_cell border: #black transparency: 0.5;
    }

[image: grafik] https://user-images.githubusercontent.com/111689536/245194936-656b37bb-e10c-4bf5-80de-82288df7fd65.png

1.

no difference if order is reverse

aspect energy {

  draw string(energy with_precision 0) size: 5  color: #black font: font("Helvetica", 20 , #bold);
  draw square (2) color: #black;
  }

1.

[image: grafik] https://user-images.githubusercontent.com/111689536/245207969-0b07b3ec-1a7f-471b-bde6-4b7cb346a0f1.png

  1. Complete Code

/** Name: Lion eating Zebras Based on the internal empty template. Author: Fusion of UNIGIS Spatial Simulation Lesson 7 + Predator Pray Model step 1 to 3 modified by: A.Schlickmann date: 12.06.23 Tags: grid, food, energy transfer, wander*/

model LionsandZebras global {

  float zebra_max_energy <- 500.0;
  float zebra_max_transfer <- 50.0;
  float zebra_energy_consum <- 5.0;
  init {
      create lions number:5 {
      age <- int(rnd(5));
      energy <- 100.0;
      }
      create zebras number: 10 {
          age <- int(rnd(5));
      }
  }

} species lions skills:[moving]{ int age; float energy;

list my_zebras;

reflex eatZebras{ my_zebras <- zebras overlapping (self + circle(10)); ask my_zebras{ do die; } }

aspect base { draw circle (2) color: #orange; } aspect energy { draw circle (2); draw string(energy with_precision 0) size: 2 color: #black;
} } species zebras skills:[moving] { int age <- 0; // maximum energy a zebra can have float max_energy <- zebra_max_energy; // max energy a zebra can consume from vegetation per step float max_transfer <- zebra_max_transfer; // living energy of the zebra at each step float energy_consum <- zebra_energy_consum;

// task: relate Zebra to the vegetation cell grid // new attribute my_cell of the type vegetation_cell // the init value: one_of the vegetation_cell. vegetation_cell my_cell <- one_of(vegetation_cell);

// energy used by each zebra at each timestep to live float energy <- rnd(max_energy) update: energy - energy_consum max: max_energy;

// locate Zebra onto a vegetation cell init{ // zebra location equals location of vegetation cell(i.e. its centroid) location <- my_cell.location; }

reflex moveAround{ my_cell <- one_of(my_cell.neighbors2); location <- my_cell.location; write location; do wander amplitude:45.0 speed: 50.0; }

reflex eat when: my_cell.food > 0 { // minimum value of the list of max transfer and my_cell.food. // if the my_cell.food is smaller than 50, only for example 25 will be transferred. float energy_transfer <- min([max_transfer, my_cell.food]); my_cell.food <- my_cell.food - energy_transfer; energy <- energy + energy_transfer; write energy; }

reflex die when: energy <= 0{ write "i starved"; do die; }

reflex get_older { age <- age +1; if age > 15 { do die_of_age; } }

action die_of_age { write "i am going to die!"; do die; }

aspect base { draw square (2) color: #black; } aspect energy {

  draw string(energy with_precision 0) size: 5  color: #black font: font("Helvetica", 20 , #bold);
  draw square (2) color: #black;

} } grid vegetation_cell width: 50 height: 50 neighbors: 8{

// max food a cell can contain float max_food <- 256.0; // food produced by cell at each step of simulation: float food_prod <- 2.0; // food displays the current quantity of food the cell can provide which will be increased each step of the simulation by food_prod float food <- rnd(255.0) max: max_food update: food+food_prod; // shades of green rgb color <- rgb(0, int(food), 0) update: rgb(0, int(food), 0); // variable neighbors10 for the vegetation_cell grid: contains for each vegetation cell to neighbors in the the distance of 10 m list neighbors2 <-self neighbors_at 2;} experiment mySimulation type: gui{ parameter "Zebra max energy: " var: zebra_max_energy category: "Zebra"; parameter "Zebra max transfer: " var: zebra_max_transfer category: "Zebra"; parameter "Zebra energy consum: " var: zebra_energy_consum category: "Zebra";

output { display svannah_default type: opengl { grid vegetation_cell border: #black transparency: 0.5; species lions aspect: base; species zebras aspect: base;

  }
  display svannah_labelled_energy type: opengl {

          species lions aspect: energy;
          species zebras aspect: energy;
          grid vegetation_cell border: #black transparency: 0.5;  
  }

}}

Expected behavior

The label should be displayed in front of the shape?

Actual behavior

The label vanishes behind the shape

System and version

*** Date: Montag, 12. Juni 2023 um 17:43:41 Mitteleuropäische Sommerzeit

*** Platform Details:

System properties: applicationXMI=org.eclipse.ui.workbench/LegacyIDE.e4xmi clearPersistedState=true ds.delayed.keepInstances=true eclipse.application=msi.gama.application.GamaApplication eclipse.buildId=${build.id} eclipse.commands=-os win32 -ws win32 -arch x86_64 -showsplash -launcher C:\Program Files\Gama\Gama.exe -name Gama --launcher.library C:\Program Files\Gama\plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.2.400.v20211117-0650\eclipse_11602.dll -startup C:\Program Files\Gama\plugins/org.eclipse.equinox.launcher_1.6.400.v20210924-0641.jar --launcher.overrideVmargs -data @nodefault https://github.com/nodefault -vm C:\Program Files\Gama./jdk/bin\server\jvm.dll eclipse.home.location=file:/C:/Program Files/Gama/ eclipse.launcher=C:\Program Files\Gama\Gama.exe eclipse.launcher.name=Gama eclipse.log.level=ERROR @./../p2 eclipse.p2.profile=DefaultProfile eclipse.product=msi.gama.application.product eclipse.startTime=1686580420726 eclipse.stateSaveDelayInterval=30000 eclipse.vm=C:\Program Files\Gama./jdk/bin\server\jvm.dll eclipse.vmargs=-server -XX:+UseG1GC -XX:+UseStringDeduplication -Dorg.eclipse.swt.graphics.Resource.reportNonDisposed=false -Xms4096m -Xmx4096m -Xss128m -Xmn1024m -XX:+UseAdaptiveSizePolicy -XX:+OptimizeStringConcat -Dosgi.locking=none -Dosgi.checkConfiguration=false -Declipse.log.level=ERROR -Dorg.eclipse.ecf.provider.filetransfer.retrieve.retryAttempts=10 -Dorg.eclipse.ecf.provider.filetransfer.retrieve.closeTimeout=6000 -Dorg.eclipse.ecf.provider.filetransfer.retrieve.readTimeout=6000 -Denable_logging=true -Duse_global_preference_store=true -Duse_precise_autoscale=false -Dread_only=false -Duse_old_tabs=true -Duse_legacy_drawers=false -Duse_delayed_resize=false -Duse_native_opengl_window=true --add-opens=java.base/java.lang=ALL-UNNAMED --add-exports=java.base/java.lang=ALL-UNNAMED --add-exports=java.desktop/sun.awt=ALL-UNNAMED --add-exports=java.desktop/sun.java2d=ALL-UNNAMED -Dsun.java2d.uiScale.enabled=false -Dfile.encoding=UTF-8 -Djava.class.path=C:\Program Files\Gama\plugins/org.eclipse.equinox.launcher_1.6.400.v20210924-0641.jar enable_logging=true equinox.init.uuid=true equinox.use.ds=true file.encoding=UTF-8 file.separator= gosh.args=--nointeractive java.class.path=C:\Program Files\Gama\plugins/org.eclipse.equinox.launcher_1.6.400.v20210924-0641.jar java.class.version=61.0 java.home=C:\Program Files\Gama\jdk java.io.tmpdir=C:\Users\besitzer\AppData\Local\Temp java.library.path=C:\Program Files\Gama;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Users\besitzer\AppData\Local\Microsoft\WindowsApps;;. java.runtime.name=OpenJDK Runtime Environment java.runtime.version=17.0.3+7 java.specification.name=Java Platform API Specification java.specification.vendor=Oracle Corporation java.specification.version=17 java.vendor=Eclipse Adoptium java.vendor.url=https://adoptium.net/ java.vendor.url.bug=https://github.com/adoptium/adoptium-support/issues java.vendor.version=Temurin-17.0.3+7 java.version=17.0.3 java.version.date=2022-04-19 java.vm.compressedOopsMode=Zero based java.vm.info=mixed mode, sharing java.vm.name=OpenJDK 64-Bit Server VM java.vm.specification.name=Java Virtual Machine Specification java.vm.specification.vendor=Oracle Corporation java.vm.specification.version=17 java.vm.vendor=Eclipse Adoptium java.vm.version=17.0.3+7 jdk.debug=release jnlp.jogamp.tmp.cache.root=jln15499710191581578661 line.separator=

native.encoding=Cp1252 org.eclipse.ecf.provider.filetransfer.retrieve.closeTimeout=6000 org.eclipse.ecf.provider.filetransfer.retrieve.readTimeout=6000 org.eclipse.ecf.provider.filetransfer.retrieve.retryAttempts=10

org.eclipse.equinox.launcher.splash.location=C:\Users\besitzer.eclipse\306334380_win32_win32_x86_64\configuration\org.eclipse.equinox.launcher\msi.gama.application_1.8.2.202207220447\splash.bmp

org.eclipse.equinox.simpleconfigurator.configUrl=file:org.eclipse.equinox.simpleconfigurator/ bundles.info org.eclipse.swt.display.useSystemTheme=true org.eclipse.swt.graphics.Resource.reportNonDisposed=false org.eclipse.swt.internal.deviceZoom=100 org.osgi.framework.executionenvironment=OSGi/Minimum-1.0, OSGi/Minimum-1.1, OSGi/Minimum-1.2, JavaSE/compact1-1.8, JavaSE/compact2-1.8, JavaSE/compact3-1.8, JRE-1.1, J2SE-1.2, J2SE-1.3, J2SE-1.4, J2SE-1.5, JavaSE-1.6, JavaSE-1.7, JavaSE-1.8, JavaSE-9, JavaSE-10, JavaSE-11, JavaSE-12, JavaSE-13, JavaSE-14, JavaSE-15, JavaSE-16, JavaSE-17 org.osgi.framework.language=de org.osgi.framework.os.name=Windows10 org.osgi.framework.os.version=10.0.0 org.osgi.framework.processor=x86-64

org.osgi.framework.storage=C:\Users\besitzer.eclipse\306334380_win32_win32_x86_64\configuration org.osgi.framework.system.capabilities=osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0, 1.1, 1.2", osgi.ee; osgi.ee="JRE"; version:List="1.0, 1.1", osgi.ee; osgi.ee="JavaSE"; version:List="1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0", osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0",osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0", osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0" org.osgi.framework.system.packages=com.sun.jarsigner, com.sun.java.accessibility.util, com.sun.jdi, com.sun.jdi.connect, com.sun.jdi.connect.spi, com.sun.jdi.event, com.sun.jdi.request, com.sun.management, com.sun.net.httpserver, com.sun.net.httpserver.spi, com.sun.nio.file, com.sun.nio.sctp, com.sun.security.auth, com.sun.security.auth.callback, com.sun.security.auth.login, com.sun.security.auth.module, com.sun.security.jgss, com.sun.source.doctree, com.sun.source.tree, com.sun.source.util, com.sun.tools.attach, com.sun.tools.attach.spi, com.sun.tools.javac, com.sun.tools.jconsole, java.applet, java.awt, java.awt.color, java.awt.datatransfer, java.awt.desktop, java.awt.dnd, java.awt.event, java.awt.font, java.awt.geom, java.awt.im, java.awt.im.spi, java.awt.image, java.awt.image.renderable, java.awt.print, java.beans, java.beans.beancontext, java.io, java.lang, java.lang.annotation, java.lang.constant, java.lang.instrument, java.lang.invoke, java.lang.management, java.lang.module, java.lang.ref, java.lang.reflect, java.lang.runtime, java.math, java.net, java.net.http, java.net.spi, java.nio, java.nio.channels, java.nio.channels.spi, java.nio.charset, java.nio.charset.spi, java.nio.file, java.nio.file.attribute, java.nio.file.spi, java.rmi, java.rmi.dgc, java.rmi.registry, java.rmi.server, java.security, java.security.cert, java.security.interfaces, java.security.spec, java.sql, java.text, java.text.spi, java.time, java.time.chrono, java.time.format, java.time.temporal, java.time.zone, java.util, java.util.concurrent, java.util.concurrent.atomic, java.util.concurrent.locks, java.util.function, java.util.jar, java.util.logging, java.util.prefs, java.util.random, java.util.regex, java.util.spi, java.util.stream, java.util.zip, javax.accessibility, javax.annotation.processing, javax.crypto, javax.crypto.interfaces, javax.crypto.spec, javax.imageio, javax.imageio.event, javax.imageio.metadata, javax.imageio.plugins.bmp, javax.imageio.plugins.jpeg, javax.imageio.plugins.tiff, javax.imageio.spi, javax.imageio.stream, javax.lang.model, javax.lang.model.element, javax.lang.model.type, javax.lang.model.util, javax.management, javax.management.loading, javax.management.modelmbean, javax.management.monitor, javax.management.openmbean, javax.management.relation, javax.management.remote, javax.management.remote.rmi, javax.management.timer, javax.naming, javax.naming.directory, javax.naming.event, javax.naming.ldap, javax.naming.ldap.spi, javax.naming.spi, javax.net, javax.net.ssl, javax.print, javax.print.attribute, javax.print.attribute.standard, javax.print.event, javax.rmi.ssl, javax.script, javax.security.auth, javax.security.auth.callback, javax.security.auth.kerberos, javax.security.auth.login, javax.security.auth.spi, javax.security.auth.x500, javax.security.cert, javax.security.sasl, javax.smartcardio, javax.sound.midi, javax.sound.midi.spi, javax.sound.sampled, javax.sound.sampled.spi, javax.sql, javax.sql.rowset, javax.sql.rowset.serial, javax.sql.rowset.spi, javax.swing, javax.swing.border, javax.swing.colorchooser, javax.swing.event, javax.swing.filechooser, javax.swing.plaf, javax.swing.plaf.basic, javax.swing.plaf.metal, javax.swing.plaf.multi, javax.swing.plaf.nimbus, javax.swing.plaf.synth, javax.swing.table, javax.swing.text, javax.swing.text.html, javax.swing.text.html.parser, javax.swing.text.rtf, javax.swing.tree, javax.swing.undo, javax.tools, javax.transaction.xa, javax.xml, javax.xml.catalog, javax.xml.crypto, javax.xml.crypto.dom, javax.xml.crypto.dsig, javax.xml.crypto.dsig.dom, javax.xml.crypto.dsig.keyinfo, javax.xml.crypto.dsig.spec, javax.xml.datatype, javax.xml.namespace, javax.xml.parsers, javax.xml.stream, javax.xml.stream.events, javax.xml.stream.util, javax.xml.transform, javax.xml.transform.dom, javax.xml.transform.sax, javax.xml.transform.stax, javax.xml.transform.stream, javax.xml.validation, javax.xml.xpath, jdk.dynalink, jdk.dynalink.beans, jdk.dynalink.linker, jdk.dynalink.linker.support, jdk.dynalink.support, jdk.javadoc.doclet, jdk.jfr, jdk.jfr.consumer, jdk.jshell, jdk.jshell.execution, jdk.jshell.spi, jdk.jshell.tool, jdk.management.jfr, jdk.net, jdk.nio, jdk.nio.mapmode, jdk.security.jarsigner, jdk.swing.interop, netscape.javascript, org.ietf.jgss, org.w3c.dom, org.w3c.dom.bootstrap, org.w3c.dom.css, org.w3c.dom.events, org.w3c.dom.html, org.w3c.dom.ls, org.w3c.dom.ranges, org.w3c.dom.stylesheets, org.w3c.dom.traversal, org.w3c.dom.views, org.w3c.dom.xpath, org.xml.sax, org.xml.sax.ext, org.xml.sax.helpers, sun.misc, sun.reflect org.osgi.framework.uuid=865f4d7d-047b-44cb-a96d-496967ccaf04 org.osgi.framework.vendor=Eclipse org.osgi.framework.version=1.10.0 org.osgi.supports.framework.extension=true org.osgi.supports.framework.fragment=true org.osgi.supports.framework.requirebundle=true os.arch=amd64 os.name=Windows 10 os.version=10.0 osgi.arch=x86_64

@. @. :start osgi.bundles.defaultStartLevel=4 osgi.checkConfiguration=false osgi.compatibility.bootdelegation=true osgi.compatibility.bootdelegation.default=true

osgi.configuration.area=file:/C:/Users/besitzer/.eclipse/306334380_win32_win32_x86_64/configuration/ osgi.framework=file:/c:/Program Files/Gama/plugins/org.eclipse.osgi_3.17.200.v20220215-2237.jar

osgi.framework.extensions=reference:file:org.eclipse.osgi.compatibility.state_1.2.600.v20220207-1403.jar osgi.framework.shape=jar osgi.framework.useSystemProperties=true osgi.frameworkClassPath=., file:c:/Program Files/Gama/plugins/org.eclipse.osgi.compatibility.state_1.2.600.v20220207-1403.jar osgi.install.area=file:/C:/Program Files/Gama/ osgi.instance.area=file:/C:/Gama/ osgi.locking=none osgi.logfile=C:\Gama.metadata.log osgi.nl=de_DE osgi.os=win32 osgi.sharedConfiguration.area=file:/c:/Program Files/Gama/configuration/

osgi.splashLocation=C:\Users\besitzer.eclipse\306334380_win32_win32_x86_64\configuration\org.eclipse.equinox.launcher\msi.gama.application_1.8.2.202207220447\splash.bmp osgi.splashPath=platform:/base/plugins/msi.gama.application osgi.syspath=c:\Program Files\Gama\plugins osgi.tracefile=C:\Gama.metadata\trace.log osgi.ws=win32 path.separator=; read_only=false sun.arch.data.model=64 sun.awt.enableExtraMouseButtons=true sun.boot.library.path=C:\Program Files\Gama\jdk\bin sun.cpu.endian=little sun.cpu.isalist=amd64 sun.io.unicode.encoding=UnicodeLittle sun.java2d.uiScale.enabled=false sun.jnu.encoding=Cp1252 sun.management.compiler=HotSpot 64-Bit Tiered Compilers sun.os.patch.level= swt.autoScale=integer use_delayed_resize=false use_global_preference_store=true use_legacy_drawers=false use_native_opengl_window=true use_old_tabs=true use_precise_autoscale=false user.country=DE user.dir=C:\Program Files\Gama user.home=C:\Users\besitzer user.language=de user.name=besitzer user.script= user.timezone=Europe/Berlin user.variant= version=1.8.2

— Reply to this email directly, view it on GitHub https://github.com/gama-platform/gama/issues/3826, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAL3WSQPSEBVCK2HJA54NGTXK5DUDANCNFSM6AAAAAAZDVIQ5M . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Schlickfrau commented 1 year ago

Dear Benoit, thank you for replying and being so kind to show the solution. I was able to implement your remarks. There is no issue anymore. It was me making a mistake and not the programm having a bug :rofl: . I changed the type: opengl to type: java2D. in my version the type: 2d casts an error. Have a sunny relaxed week, Andrea

display svannah_labelled_energy type: java2D {
    grid vegetation_cell border: #black transparency: 0.5;
    species lions aspect: energy;
    species zebras aspect: energy;

and the output is fine grafik