{"action":"opened","issue":{"url":"https://api.github.com/repos/gama-platform/gama/issues/2053","repository_url":"https://api.github.com/repos/gama-platform/gama","labels_url":"https://api.github.com/repos/gama-platform/gama/issues/2053/labels{/name}","comments_url":"https://api.github.com/repos/gama-platform/gama/issues/2053/comments","events_url":"https://api.github.com/repos/gama-platform/gama/issues/2053/events","html_url":"https://github.com/gama-platform/gama/issues/2053","id":191614598,"number":2053,"title":"Inheritance issue in Gama: Cannot update attribute of the son","user":{"login":"tungohuu","id":23327149,"avatar_url":"https://avatars.githubusercontent.com/u/23327149?v=3","gravatar_id":"","url":"https://api.github.com/users/tungohuu","html_url":"https://github.com/tungohuu","followers_url":"https://api.github.com/users/tungohuu/followers","following_url":"https://api.github.com/users/tungohuu/following{/other_user}","gists_url":"https://api.github.com/users/tungohuu/gists{/gist_id}","starred_url":"https://api.github.com/users/tungohuu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tungohuu/subscriptions","organizations_url":"https://api.github.com/users/tungohuu/orgs","repos_url":"https://api.github.com/users/tungohuu/repos","events_url":"https://api.github.com/users/tungohuu/events{/privacy}","received_events_url":"https://api.github.com/users/tungohuu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-25T02:34:41Z","updated_at":"2016-11-25T02:34:41Z","closed_at":null,"body":"### Steps to reproduce\r\n1. Create a species (father) from shape file. The mother has an attribute \"color<-#gray\"\r\n\r\n2. Create inheritance species (son) from the mother above. Update the attribute \"color<-#red\"\r\n\r\n3. Print out the value of the attribute \"write color\" of the son\r\n===== here is the code =====\r\nmodel v1\r\n\r\nglobal {\r\n\tfile building_file <- shape_file(\"../includes/hanoi_polygon/hanoi_vietnam_osm_polygon.shp\");\r\n\tgeometry shape <- envelope(building_file);\r\n\tfloat step <- 1 #mn; \r\n\t\r\n\tinit {\t\t \t\r\n\t\tcreate building from: building_file {\r\n\t\t\tshape<-shape simplification 0.7;\r\n\t\t}\r\n\t\t\r\n\t\task 1 among ( building ) {\r\n\t\t\t\r\n\t\t\tcreate energy_control number:1 {\r\n\t\t\t      self.color <- #red;// update color of this species\t\t\t      \r\n\t\t\t      self.location <- myself.location;\r\n\t\t\t      self.shape <- myself.shape;\t\t\t      \r\n\t\t\t}\r\n\t\t\tdo die;\t\t\t\r\n\t\t}\t\t \r\n\t}\t\t\r\n}\r\n\r\nspecies building {\r\n\trgb color <- #gray;\t\t\r\n\taspect geom {\t\t \r\n\t\t draw shape color: color;\r\n\t}\r\n}\r\n\r\n\r\nspecies energy_control parent: building {\r\n\t\t\r\n\treflex upd\r\n\t{\r\n\t\twrite color; // this prints \"gray\" although I update the color when I create this species\r\n\t}\r\n\r\n}\r\n\r\nexperiment test type: gui {\t\t\r\n\t\r\n\toutput { \r\n\t\tdisplay map type: opengl {\r\n              \tspecies building aspect: geom  refresh: false; \r\n              \tspecies energy_control aspect: geom;               \t\r\n        }\r\n\t}\t\r\n}\r\n\r\n### Expected behavior\r\nthe value printed out is \"red\"\r\n\r\n### Actual behavior\r\nthe value printed out is \"gray\"\r\n\r\n### System and version \r\nGama 1.7\r\n\r\n"}}
{"actor":{"display_login":"tungohuu"}}