コード例 #1
0
from pyVisitors import ToVibes
import numpy as np



if __name__ == '__main__':

    params = {'color_in': '#888888[#444444]', 'color_out':
                  '#888888[#DDDDDD]', 'color_maybe': '#888888[w]'}
    vibes.beginDrawing()


    P = IntervalVector(2, [-4, 4])
    A = Paving(P,BoolInterval(YES))
    f = Function("x", "y", "x^2 + y^2")
    pdcA = pyPdcIn(f, IntervalVector(1, [0, 3]), IntervalVector(1, [4, 1000]))
    A.Sivia(pdcA,ibex.op_And,0.03);
    A.visit(ToVibes(10, "Aset"))
    
    B = Paving(P,BoolInterval(YES));
    f = Function("x[2]", 'x[0]^2 + (1 + x[1])^2 + (x[0] + x[1])^2')
    pdcB = pyPdcIn(f, IntervalVector(1, [0, 3]), IntervalVector(1, [6, 10000]))
    B.Sivia(pdcB,ibex.op_And,0.03);
    B.visit(ToVibes(10, "Bset"))
    
    AmoinsB = Paving(P, MAYBE);
    op_binaire(AmoinsB,A,B,ibex.op_Restrict);
    AmoinsB.visit(ToVibes(10, "AmoinsB"))
    
    BmoinsA = Paving(2);
    op_binaire(BmoinsA,B,A,ibex.op_Restrict);
コード例 #2
0
ファイル: paving_example2.py プロジェクト: SimonRohou/pyIbex
import pyIbex as ibex
from pyPredicate import pyPdcIn
from pyVisitors import ToVibes
import numpy as np

if __name__ == '__main__':

    params = {'color_in': '#888888[#444444]', 'color_out':
                      '#888888[#DDDDDD]', 'color_maybe': '#888888[w]'}
    vibes.beginDrawing()
    
    
    P = IntervalVector(2, [-4, 4])
    X = Paving(P,BoolInterval(YES))
    f = Function("x", "y", "x^2 + y^2")
    pdcX = pyPdcIn(f, IntervalVector(1, [0, 3]), IntervalVector(1, [4, 1000]))
    X.Sivia(pdcX,ibex.op_And,0.03);
    X.visit(ToVibes(10, "X"))
    
    B_in = Paving(P,BoolInterval(YES));
    f = Function("x[2]", '(x[0]-0.5)^2 + x[1]^2')
    pdcB_in = pyPdcIn(f, IntervalVector(1, [0, 0.03]))
    B_in.Sivia(pdcB_in,ibex.op_And,0.03);
    B_in.visit(ToVibes(10, "B_in"))

    B_out = Paving(P,BoolInterval(YES));
    f = Function("x[2]", '(x[0]-1)^2 + (x[1]-1)^2')
    pdcB_out = pyPdcIn(f, IntervalVector(1, [0, 0.15]))
    B_out.Sivia(pdcB_out,ibex.op_And,0.03);
    B_out.visit(ToVibes(10, "B_out"))
コード例 #3
0
        'color_in': '#888888[#444444]',
        'color_out': '#888888[#DDDDDD]',
        'color_maybe': '#888888[w]'
    }
    vibes.beginDrawing()

    P = IntervalVector(2, [-4, 4])
    A = Paving(P, YES)
    X = Paving(P, MAYBE)

    B_in = Paving(P, YES)
    B_out = Paving(P, YES)
    eps = 0.02

    f = Function("x", "y", "x^2 + y^2")
    ThickDisk = pyPdcIn(f, IntervalVector(1, [0, 3]))
    f = Function("x[2]", '(x[0]-0.5)^2 + x[1]^2')
    Pastille_in = pyPdcIn(f, IntervalVector(1, [0, 0.3]))
    f = Function("x[2]", '(x[0]-1)^2 + (x[1]-1)^2')
    Pastille_out = pyPdcIn(f, IntervalVector(1, [0, 0.15]))

    A.Sivia(ThickDisk, op_And, eps)
    A.visit(ToVibes(10, "A"))

    B_in.Sivia(Pastille_in, op_And, eps)
    B_in.visit(ToVibes(10, "B_in"))

    B_out.Sivia(Pastille_out, op_And, eps)
    B_out.visit(ToVibes(10, "B_out"))

    Set_Contractor_Subset(X, A)
コード例 #4
0
ファイル: paving_example3.py プロジェクト: SimonRohou/pyIbex
if __name__ == '__main__':

    params = {'color_in': '#888888[#444444]', 'color_out':
                  '#888888[#DDDDDD]', 'color_maybe': '#888888[w]'}
    vibes.beginDrawing()
    
    P = IntervalVector(2, [-4, 4])
    A = Paving(P,YES);
    X = Paving(P,MAYBE);

    B_in = Paving(P,YES);
    B_out = Paving(P,YES);
    eps = 0.02

    f = Function("x", "y", "x^2 + y^2")
    ThickDisk = pyPdcIn(f, IntervalVector(1, [0, 3]))
    f = Function("x[2]", '(x[0]-0.5)^2 + x[1]^2')
    Pastille_in = pyPdcIn(f, IntervalVector(1, [0, 0.3]))
    f = Function("x[2]", '(x[0]-1)^2 + (x[1]-1)^2')
    Pastille_out = pyPdcIn(f, IntervalVector(1, [0, 0.15]))

    A.Sivia(ThickDisk,op_And,eps);
    A.visit(ToVibes(10, "A"))
    
    B_in.Sivia(Pastille_in,op_And,eps);
    B_in.visit(ToVibes(10, "B_in"))
    
    B_out.Sivia(Pastille_out,op_And,eps);
    B_out.visit(ToVibes(10, "B_out"))