Commit de270513 authored by Thibaut Démare's avatar Thibaut Démare

Debug issue with list

parent 0172adf9
...@@ -37,7 +37,7 @@ global { ...@@ -37,7 +37,7 @@ global {
// A boolean attribute // A boolean attribute
gs_add_edge_attribute gs_sender_id:"test1" gs_edge_id:"edge1" gs_attribute_name:"boolean" gs_attribute_value:true; gs_add_edge_attribute gs_sender_id:"test1" gs_edge_id:"edge1" gs_attribute_name:"boolean" gs_attribute_value:true;
// A list attribute // A list attribute
//gs_add_edge_attribute gs_sender_id:"test1" gs_edge_id:"edge1" gs_attribute_name:"list" gs_attribute_value:["one","two","three"]; gs_add_edge_attribute gs_sender_id:"test1" gs_edge_id:"edge1" gs_attribute_name:"list" gs_attribute_value:[1,2,3];
// Step // Step
gs_step gs_sender_id:"test1" gs_step_number:1; gs_step gs_sender_id:"test1" gs_step_number:1;
......
...@@ -22,7 +22,7 @@ import org.graphstream.gama.extension.IKeywordGSAdditional; ...@@ -22,7 +22,7 @@ import org.graphstream.gama.extension.IKeywordGSAdditional;
@facets(value = { @facet(name = IKeywordGSAdditional.SENDERID, type = IType.STRING, optional = false), @facets(value = { @facet(name = IKeywordGSAdditional.SENDERID, type = IType.STRING, optional = false),
@facet(name = IKeywordGSAdditional.EDGE_ID, type = IType.STRING, optional = false), @facet(name = IKeywordGSAdditional.EDGE_ID, type = IType.STRING, optional = false),
@facet(name = IKeywordGSAdditional.ATTRIBUTE_NAME, type = IType.STRING, optional = false), @facet(name = IKeywordGSAdditional.ATTRIBUTE_NAME, type = IType.STRING, optional = false),
@facet(name = IKeywordGSAdditional.ATTRIBUTE_VALUE, type = IType.NONE, optional = false)}) @facet(name = IKeywordGSAdditional.ATTRIBUTE_VALUE, type = IType.LIST, optional = false)})
public class AddEdgeAttributeStatement extends AbstractStatement implements IStatement{ public class AddEdgeAttributeStatement extends AbstractStatement implements IStatement{
final IExpression senderid; final IExpression senderid;
...@@ -45,7 +45,14 @@ public class AddEdgeAttributeStatement extends AbstractStatement implements ISta ...@@ -45,7 +45,14 @@ public class AddEdgeAttributeStatement extends AbstractStatement implements ISta
String an = (String)(attname.value(scope)); String an = (String)(attname.value(scope));
Object av = attval.value(scope); Object av = attval.value(scope);
GSSender sender = GSManager.getSender(s); GSSender sender = GSManager.getSender(s);
sender.sendEdgeAttributeAdded(eid, an, av); // If it is a GamaList, it must be cast to an array
if(av instanceof msi.gama.util.GamaList){
Object[] av_ar = ((msi.gama.util.GamaList) av).toArray();
sender.sendEdgeAttributeAdded(eid, an, av_ar);
}
else {
sender.sendEdgeAttributeAdded(eid, an, av);
}
return null; return null;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment