Ejemplo n.º 1
0
 def WriteXMLNode(self, root,recordSha=True):
   """
   Write problem to xml node
   """
   if(recordSha):
     theGitSha = GetGitSha()
     SetAttributeString(root,"sha",theGitSha)
   
   #Functions
   theFunctionManager = FunctionManager()  
   funcMngrNode = AddChild(root,"Functions")
   theFunctionManager.WriteXMLNode(funcMngrNode) 
   
   # Mine data
   mineNode = AddChild(root,"MineData")
   self.theMineDataManager.WriteXMLNode(mineNode)
   
   # Output
   outputNode = AddChild(root,"Output")
   SetAttributeString(outputNode,"prefix",self.outputPrefix)
   
   # Actions
   #theActionManager = ActionManager()        
   actnMngrNode = AddChild(root,"Actions")
   self.theActionManager.WriteXMLNode(actnMngrNode) 
   
   return root
Ejemplo n.º 2
0
        def WriteXMLNode(self, node):
            """
        Write solvers to xml node.
        """

            # solvers
            for name, solver in self.solvers.items():
                type = solver.typeStr
                solvNode = AddChild(node, type)
                solvNode.SetAttributeString("name", name)
                solver.WriteXMLNode(solvNode)

            return node
    def WriteXMLNode(self, node):
        """
      Write data to xml node
      """

        # discount rate
        SetAttributeString(node, "discountRate", self.discountRate)
        SetAttributeString(node, "incomeTaxRate", self.incomeTaxRate)
        SetAttributeString(node, "GandAFraction", self.GandAFraction)
        SetAttributeString(node, "state", self.state)

        # price data
        for name, price in self.referenceCommodityPrices.items():
            commNode = AddChild(node, "Commodity")
            SetAttributeString(commNode, "name", name)
            SetAttributeString(commNode, "price", price)
            SetAttributeString(commNode, "sigma",
                               self.commodityPriceSigmas[name])

        # inflation
        SetAttributeString(node, "inflation", self.inflation)

        SetAttributeString(node, "btNPV", self.btNPV)
        SetAttributeString(node, "atNPV", self.atNPV)

        return node
Ejemplo n.º 4
0
 def WriteXMLNode(self, node): 
    """Write the iterator action to an xml tree node."""
    SetAttributeString(node,"number",self.number)
    for action in self.actions:
       type = action.typeStr
       actnNode = AddChild(node,type)
       action.WriteXMLNode(actnNode)
    return node
Ejemplo n.º 5
0
        def WriteXMLNode(self, node):
            """
        Write problem to xml node
        """

            # functions
            for name, usrFunc in self.functions.items():
                type = usrFunc.typeStr
                funcNode = AddChild(node, type)
                usrFunc.WriteXMLNode(funcNode)

            return node
Ejemplo n.º 6
0
    def WriteXMLNode(self, node):
        """
      Write problem to xml node
      """

        # Location
        locNode = AddChild(node, "Location")
        SetAttributeString(locNode, "lat", self.mineLatLong[0])
        SetAttributeString(locNode, "long", self.mineLatLong[1])

        # Orebody
        orebodyNode = AddChild(node, "Orebody")
        self.theOreBody.WriteXMLNode(orebodyNode)

        # Economics Node
        economicsNode = AddChild(node, "Economics")
        self.theEconomicDataManager.WriteXMLNode(economicsNode)

        # Mining System Node
        miningNode = AddChild(node, "Mining")
        self.theMiningSystem.WriteXMLNode(miningNode)

        # Processing System Node
        processingNode = AddChild(node, "Processing")
        self.theProcessingSystem.WriteXMLNode(processingNode)

        # Infrastructure Node
        infrastructureNode = AddChild(node, "Infrastructure")
        self.theInfrastructureManager.WriteXMLNode(infrastructureNode)

        return node
Ejemplo n.º 7
0
 def WriteXMLNode(self, node):
   """
   Write hydrogen data manager to xml node.
   """
   
   # Location
   locNode = AddChild(node,"Location")
   SetAttributeString(locNode,"lat",self.latLong[0])
   SetAttributeString(locNode,"long",self.latLong[1])
     
   # Economics Node
   economicsNode = AddChild(node,"Economics")
   self.theEconomicDataManager.WriteXMLNode(economicsNode)
   
   # Hydrogen Plant Node
   hydrogenPlantNode = AddChild(node,"HydrogenPlant")
   self.theHydrogenPlant.WriteXMLNode(hydrogenPlantNode)
   
   # Power Plant Node
   powerPlantNode = AddChild(node,"PowerPlant")
   self.thePowerPlant.WriteXMLNode(powerPlantNode)
   
   if(self.theEnergyStorage):
     energyStorageNode = AddChild(node,"EnergyStorage")
     self.theEnergyStorage.WriteXMLNode(energyStorageNode)
   
   # Infrastructure Node
   infrastructureNode = AddChild(node,"Infrastructure")
   self.theInfrastructureManager.WriteXMLNode(infrastructureNode)
   
   #if(self.theRehabilitationManager):
   #  rehabilitationNode = AddChild(node,"Rehabilitation")
   #  self.theRehabilitationManager.WriteXMLNode(rehabilitationNode)
   
   return node
    def WriteXMLNode(self, node):
        """
      Write processing system data to xml node
      """
        # Processing data
        SetAttributeString(node, "method", self.processingMethod)
        SetAttributeString(node, "processingLoss", self.processingLoss)
        SetAttributeString(node, "refiningTake", self.refiningTake)

        if (self.secondaryProcessingSystem):
            secondaryNode = AddChild(node, "SecondarySystem")
            self.secondaryProcessingSystem.WriteXMLNode(secondaryNode)

        return node
Ejemplo n.º 9
0
    def WriteXMLNode(self, node):
        """
      Write ore body to xml node
      """
        SetAttributeString(node, "type", self.type)
        SetAttributeString(node, "dip", self.dip)

        SetAttributeString(node, "length", self.length)
        SetAttributeString(node, "width", self.width)
        SetAttributeString(node, "height", self.height)
        SetAttributeString(node, "cover", self.cover)

        # price data
        for name, grade in self.metalGrades.items():
            commNode = AddChild(node, "Commodity")
            SetAttributeString(commNode, "name", name)
            SetAttributeString(commNode, "grade", grade)

        return node