use of com.github.zhenwei.core.asn1.x509.Attribute in project vsp-playgrounds by matsim-vsp.
the class XMLWriter method addDeparture.
public void addDeparture(Element departures_element, Departure departure) {
Element dep = new Element("departure");
dep.setAttribute(new Attribute("id", departure.getId()));
dep.setAttribute(new Attribute("vehicleRefId", departure.getVehicleRefId()));
dep.setAttribute(new Attribute("departureTime", departure.getDepartureTime()));
departures_element.addContent(dep);
}
use of com.github.zhenwei.core.asn1.x509.Attribute in project vsp-playgrounds by matsim-vsp.
the class XMLWriter method addStopFacility.
public void addStopFacility(Element tstops, Stop stop) {
Element stopFacility = new Element("stopFacility");
stopFacility.setAttribute(new Attribute("isBlocking", Boolean.toString(stop.getIsBlocking())));
stopFacility.setAttribute(new Attribute("name", stop.getName()));
Coord coord = stop.getCoord();
coord = ct.transform(coord);
stopFacility.setAttribute(new Attribute("x", Double.toString(coord.getX())));
stopFacility.setAttribute(new Attribute("y", Double.toString(coord.getY())));
stopFacility.setAttribute(new Attribute("id", stop.getId()));
tstops.addContent(stopFacility);
}
use of com.github.zhenwei.core.asn1.x509.Attribute in project vsp-playgrounds by matsim-vsp.
the class XMLWriter method addLink.
public void addLink(Element route, Link link) {
Element link_element = new Element("link");
// Temporarily for teleportation
link_element.setAttribute(new Attribute("refId", ""));
route.addContent(link_element);
}
use of com.github.zhenwei.core.asn1.x509.Attribute in project vsp-playgrounds by matsim-vsp.
the class XMLWriter method addStop.
public void addStop(Element transitRoute, Stop st) {
Element stop = new Element("stop");
stop.setAttribute(new Attribute("awaitDeparture", Boolean.toString(st.getAwaitDeparture())));
stop.setAttribute(new Attribute("departureOffset", st.getDepartureOffset()));
stop.setAttribute(new Attribute("arrivalOffset", st.getArrivalOffset()));
stop.setAttribute(new Attribute("refId", st.getId()));
transitRoute.addContent(stop);
}
use of com.github.zhenwei.core.asn1.x509.Attribute in project mars-sim by mars-sim.
the class CrewConfig method createItemDoc.
/**
* Creates an XML document for this crew.
*
* @return
*/
@Override
protected Document createItemDoc(Crew roster) {
Element root = new Element(CREW_COFIG);
Document doc = new Document(root);
root.setAttribute(new Attribute(NAME_ATTR, roster.getName()));
root.setAttribute(new Attribute(DESC_ATTR, roster.getDescription()));
Element crewList = new Element(CREW_LIST);
List<Element> personList = new ArrayList<>();
for (Member person : roster.getTeam()) {
Element personElement = new Element(PERSON);
personElement.setAttribute(new Attribute(NAME_ATTR, person.getName()));
personElement.setAttribute(new Attribute(GENDER, person.getGender().name()));
personElement.setAttribute(new Attribute(AGE, person.getAge()));
personElement.setAttribute(new Attribute(PERSONALITY_TYPE, person.getMBTI()));
saveOptionalAttribute(personElement, SPONSOR, person.getSponsorCode());
personElement.setAttribute(new Attribute(COUNTRY, person.getCountry()));
personElement.setAttribute(new Attribute(JOB, person.getJob()));
saveOptionalAttribute(personElement, ACTIVITY, person.getActivity());
saveOptionalAttribute(personElement, MAIN_DISH, person.getMainDish());
saveOptionalAttribute(personElement, SIDE_DISH, person.getSideDish());
saveOptionalAttribute(personElement, DESSERT, person.getDessert());
//
// Element traitList = new Element(PERSONALITY_TRAIT_LIST);
//
// Element trait0 = new Element(PERSONALITY_TRAIT);
// trait0.setAttribute(new Attribute(NAME, "openness"));
// trait0.setAttribute(new Attribute(VALUE, "25"));
// traitList.addContent(trait0);
personList.add(personElement);
}
crewList.addContent(personList);
doc.getRootElement().addContent(crewList);
return doc;
}
Aggregations