Measures/m_5_example_5_computed_schedule/resources/util.rb
# Returns true if the material was removed
Returns true if the material was removed
Returns true if the material was removed
def remove_material(constr, material_name, runner)
            num_layers = constr.numLayers
            constr.layers.reverse.each_with_index do |layer, index|
                layer_index = num_layers - 1 - index
                if layer.name.to_s.start_with?(material_name) or material_name.start_with?(layer.name.to_s)
                    constr.eraseLayer(layer_index)
                    return true
                end
            end
            return false
        end
def remove_material ( constr , material_name , runner ) num_layers = constr . numLayers constr . layers . reverse . each_with_index do | layer , index | layer_index = num_layers - 1 - index if layer . name . to_s . start_with? ( material_name ) or material_name . start_with? ( layer . name . to_s ) constr . eraseLayer ( layer_index ) return true end end return false end
Returns true if the material was removed
Returns true if the material was removed
# Remove layer if it matches this name
constr
<not_specific>
material_name
<not_specific>
runner
<not_specific>