a.binder il y a 9 ans
Parent
commit
e6360c06d0

+ 68 - 0
SE/dev/php-cli/build_edge_paths_with_PE_controll_loop.xsl

@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:bp="https://procesy5.pl/biale_plamy-schema.xsd"
+    exclude-result-prefixes="xs"
+    version="2.0">
+    
+    <xsl:param name="edge_paths_with_PE_controll_temp" select="'edge_paths_with_PE_controll_temp'"/>
+    <xsl:param name="edge_paths_with_PE_controll_temp.alias" select="'edge_paths_with_PE_controll_temp.alias'"/>
+    <xsl:param name="edge_paths_with_PE_controll.xsl" select="'edge_paths_with_PE_controll.xsl'"/>
+    <xsl:param name="edge_paths_with_PE_controll.xml" select="'edge_paths_with_PE_controll.xml'"/>
+    <xsl:param name="edge_paths_with_PE_controll_paths_temp" select="'edge_paths_with_PE_controll_paths_temp'"/>
+    
+    <xsl:param name="edge_joins_filled_paths" select="'edge_joins_filled_paths'"/>
+    <xsl:param name="PE_Price" select="2500"/>
+    <xsl:param name="Cable_Price" select="3"/>
+    <xsl:param name="max_combinate_groups_elements" select="10"/> <!-- po ile wezlow mamy grupowac do wyliczania kombinacji kosztow -->
+    <xsl:param name="logic" select="'grouped'"/>
+    
+    <xsl:output indent="yes"/>
+    <xsl:strip-space elements="*"/>
+    
+    <xsl:template match="edge_joins_filled_paths">
+        <project basedir="." name="edge_paths_with_PE_controll_loop.xml" default="edge_paths_with_PE_controll_loop">
+            <target name="edge_paths_with_PE_controll_loop">
+                
+                
+                
+                
+                <delete dir="{$edge_paths_with_PE_controll_temp}"/>
+                <delete dir="{$edge_paths_with_PE_controll_temp.alias}"/>
+                <mkdir dir="{$edge_paths_with_PE_controll_temp}"/>
+                <symlink link="{$edge_paths_with_PE_controll_temp.alias}" resource="{$edge_paths_with_PE_controll_temp}"/>
+                
+                
+                
+                <xsl:apply-templates>
+                    <xsl:sort select="item/asText/@len" />
+                </xsl:apply-templates>
+            </target>
+        </project>
+    </xsl:template>
+    
+    
+    <xsl:template match="item">
+        
+        
+        <delete file="{$edge_paths_with_PE_controll_paths_temp}/{$edge_paths_with_PE_controll.xsl}.{@id}.xml"/>
+        <xslt basedir="./" style="{$edge_paths_with_PE_controll.xsl}" 
+            in="{$edge_joins_filled_paths}/{$edge_joins_filled_paths}.{@id}.xml"  destdir="./" 
+            out="{$edge_paths_with_PE_controll_paths_temp}/{$edge_paths_with_PE_controll.xsl}.{@id}.xml" >
+            <factory name="net.sf.saxon.TransformerFactoryImpl">    
+                <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
+                <!--<attribute name="http://saxon.sf.net/feature/initialMode" value="DITA_PARSE_templ"/>-->
+                <!--<attribute name="http://saxon.sf.net/feature/initialTemplate" value="asd"/>-->
+            </factory>
+            <classpath location="/opt/local/share/java/saxon9he.jar"/>
+            <param name="edge_paths_with_PE_controll_temp" expression="{$edge_paths_with_PE_controll_temp}"/>
+            <param name="edge_paths_with_PE_controll_temp.alias" expression="{$edge_paths_with_PE_controll_temp.alias}"/>
+            <param name="PE_Price" expression="{$PE_Price}"/>
+            <param name="Cable_Price" expression="{$Cable_Price}"/>
+            <param name="max_combinate_groups_elements" expression="{$max_combinate_groups_elements}"/> <!-- po ile wezlow mamy grupowac do wyliczania kombinacji kosztow -->
+            <param name="logic" expression="{$logic}"/>
+            <!--<xsl:param name="logic" select="'sorted'"/>--> <!-- tutaj robi grupy ale analizyje w grupie tylko wazniejsze/bardziej oblozone wezly -->
+        </xslt>
+    </xsl:template>
+    
+</xsl:stylesheet>

+ 3 - 3
SE/dev/php-cli/edge_paths_with_PE_controll.xsl

@@ -18,7 +18,7 @@
     <xsl:param name="logic" select="'grouped'"/> <!-- tutaj robi grupy po $max_combinate_groups_elements -->
     <!--<xsl:param name="logic" select="'sorted'"/>--> <!-- tutaj robi grupy ale analizyje w grupie tylko wazniejsze/bardziej oblozone wezly -->
     
-    <xsl:param name="debug" select="1"/>
+    <xsl:param name="debug" />
     
     
     <!--<xsl:param name="edge_paths_with_PE.xml"/>-->
@@ -105,7 +105,7 @@
         <!-- rozmieszczamy prawidlowo PE na danej trasie -->
         <xsl:variable name="EconomicDistanceCut">
             <EconomicDistanceCut>
-                <xsl:for-each select="$edge_joins_filled_path/edge_joins_filled_paths_xml/asText_XMl/LineString">
+                <xsl:for-each select="$edge_joins_filled_path/edge_joins_filled_paths_xml/asText_XMl/LineString[not(@error)]">
                         <distance>
                             <xsl:attribute name="pos" select="position()"/>
                             <xsl:attribute name="not_id" select="@not_id"/>
@@ -584,7 +584,7 @@
                     <xsl:variable name="way_dn_len">
                         <xsl:choose>
                             <xsl:when test="$way_dn_id">
-                                <xsl:value-of select="  $candidates_merged_with_poprzednie/bp:Path_Point[@ID_Join=$way_dn_id]/number(@distance ) -  current()/@distance"/>
+                                <xsl:value-of select=" number( $candidates_merged_with_poprzednie/bp:Path_Point[@ID_Join=$way_dn_id]/@distance ) -  current()/@distance"/>
                             </xsl:when>
                             <xsl:otherwise><xsl:value-of select="-1"/></xsl:otherwise>
                         </xsl:choose>