Exemplo n.º 1
0
	public XMLElement saveSelf () throws XMLCannotSaveException
	{ 	XMLElement result=super.saveSelf();
		result.setName(shortXMLName);
		result.addAttribute(new XMLAttribute ("random-chance",random_chance));
		result.addAttribute(new XMLAttribute ("gamma",gamma));
	  	return result;
	}
Exemplo n.º 2
0
 public void load(XMLElement myElement, XMLLoader loader)
     throws XMLTreeException, IOException, XMLInvalidInputException {
   super.load(myElement, loader);
   gamma = myElement.getAttribute("gamma").getFloatValue();
   random_chance = myElement.getAttribute("random-chance").getFloatValue();
   q_table = (float[][][][]) XMLArray.loadArray(this, loader);
   // v_table=(float[][][])XMLArray.loadArray(this,loader);
   count = (Vector) XMLArray.loadArray(this, loader, this);
   // p_table=(Vector)XMLArray.loadArray(this,loader,this);
 }
Exemplo n.º 3
0
		public XMLElement saveSelf () throws XMLCannotSaveException
		{ 	XMLElement result=new XMLElement("pktlval");
			result.addAttribute(new XMLAttribute("tl-id",tl.getId()));
			result.addAttribute(new XMLAttribute("pos",pos));
			result.addAttribute(new	XMLAttribute("destination",destination.getId()));
			result.addAttribute(new XMLAttribute("light",light));
			result.addAttribute(new XMLAttribute("newtl-id",tl_new.getId()));
			result.addAttribute(new XMLAttribute("new-pos",pos_new));
			result.addAttribute(new XMLAttribute("value",value));
			result.addAttribute(new XMLAttribute("ktl",Ktl));
	  		return result;
		}
Exemplo n.º 4
0
		public void load (XMLElement myElement,XMLLoader loader) throws XMLTreeException,IOException,XMLInvalidInputException
		{	pos=myElement.getAttribute("pos").getIntValue();
		   	loadData.oldTlId=myElement.getAttribute("tl-id").getIntValue();
			loadData.destNodeId=myElement.getAttribute("destination").getIntValue();
		   	light=myElement.getAttribute("light").getBoolValue();
			loadData.newTlId=myElement.getAttribute("newtl-id").getIntValue();
			pos_new=myElement.getAttribute("new-pos").getIntValue();
			Ktl=myElement.getAttribute("ktl").getIntValue();
			value=myElement.getAttribute("value").getFloatValue(); 
		}
Exemplo n.º 5
0
		public XMLElement saveSelf () throws XMLCannotSaveException
		{ 	XMLElement result=new XMLElement("count");
			result.addAttribute(new XMLAttribute("tl-id",tl.getId()));
			result.addAttribute(new XMLAttribute("pos",pos));
			result.addAttribute(new	XMLAttribute("destination",destination.getId()));
			result.addAttribute(new XMLAttribute("light",light));
			result.addAttribute(new XMLAttribute("newtl-id",tl_new.getId()));
			result.addAttribute(new XMLAttribute("new-pos",pos_new));
			result.addAttribute(new XMLAttribute("ktl",Ktl));
			result.addAttribute(new XMLAttribute("value",value));
			if ( ! infrastructure.laneDictionary.containsKey
			     (new Integer (tl.getId())))
			{     
			     System.out.println
			     ("WARNING : Unknown Trafficlight ID "+tl.getId()+
			      " in TC3$CountEntry. Loading will go wrong");
			}
	  		return result;
		}
Exemplo n.º 6
0
		public XMLElement saveSelf () throws XMLCannotSaveException
		{ 	XMLElement result=new XMLElement("target");
			result.addAttribute(new XMLAttribute("tl-id",tl.getId()));
			result.addAttribute(new XMLAttribute("pos",pos));
	  		return result;
		}
Exemplo n.º 7
0
		public void load (XMLElement myElement,XMLLoader loader) throws XMLTreeException,IOException,XMLInvalidInputException
		{	pos=myElement.getAttribute("pos").getIntValue();
		   	loadData.tlId=myElement.getAttribute("tl-id").getIntValue();
		}