设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14168|回复: 2

[求助] Automod Syntax 编译的一个问题

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, K; }9 m* ?8 w7 r8 v! l! {& P  ^4 A% t4 C. ^  N; _- M4 ~
我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。
+ j- q" l* k2 M0 k  x% a/ l4 g) `* F5 V
begin P_read arriving2 N' K: N3 m+ Y9 m  B/ p
    while 1=1 do begin. j6 [& X; A6 w) N2 p  ?& f6 h
        read A_tote from "data.txt" with delimiter "\n"* \# ?* n1 n; W( Z0 U/ q
        read A_time from "data.txt" with delimiter "\n"* N* {/ W5 _5 U! @: B
        read A_leave from "data.txt" with delimiter "\n"
6 g9 f7 x, w2 p( C& S/ X        read A_picks from "data.txt" with delimiter "\n"0 K3 `; H% h2 I: j" v# I0 u
        set load type to A_tote; C6 H- \$ A1 `* }3 f
        if A_tote="tote 1" then set A_induct to 12 G) d: c( }) I, g, F
        else if A_tote="tote 2" then set A_induct to 2
$ n: o: j5 v+ j, B4 J+ |7 L            else set A_induct to 3   
1 m7 x% q1 I2 x/ `9 ]( ^! C. C        set A_i to 0
9 x" h% z1 m" p' l; C" i        clone 1 load to P_induction# ~3 p8 K* p7 s2 I+ f
        wait for A_time sec3 p8 P( Y  n. _" O6 b9 a
    end
: g7 p4 Y0 i$ b( }$ _& E% O  _end
' a+ y4 d" l# M% p4 w2 L3 x: k8 w5 {2 Z8 m" W% i( ^
begin P_induction arriving$ Z# @; w( `. L) i: l! z8 T! R
    if A_induct=1 then clone 1 load to P_pick1" @5 x  l, P+ ]- _
    else if A_induct=2 then clone 1 load to P_pick2+ t$ M6 j) r* R( ?5 X  B" e/ v$ B! b
        else clone 1 load to P_pick3
) d' |0 F8 R  u# S0 ~- eend
" Q5 y+ U$ }4 V' A0 I, ~$ [. [2 z* K1 x' S5 O: b: ?
begin P_pick1 arriving
& m; I4 b8 \% L/ V) V) B) c    set A_i to 12 I7 x% @9 R- P4 x4 }/ j9 y: |
    move into Q_induct1" m8 x9 \# Y3 Q3 g6 j
    move into pickaisle.induct1
: C/ L7 O5 c1 T" i! R  D, @    while A_i<=30 do begin* L8 r3 i' n2 P! H4 E8 p" i
        travel to pickaisle.con(A_i)
! N$ r, _1 e6 y7 h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 V& G8 T0 |+ D, r. V( b        else wait for 10 sec+ h5 B2 Y# n4 D' @% b$ d
        if A_i=A_leave then send to die0 R( b( L* F- {+ E( b1 o/ |
        else inc A_i by 1$ r3 `& ]; }& O+ V
    end1 [" l' @& Z6 d$ H- X$ K* b
end
/ H$ L, s. @  l; ^* S  d: [: V- e7 z4 a* B! ?0 Z: i
begin P_pick2 arriving
" ]0 M3 L2 k) g    set A_i to 116 w. D! J: L8 q( _: ]$ B- h5 ]
    move into Q_induct2# o) |2 z5 d5 B  U; g3 Z
    move into pickaisle.induct2) Q5 M5 m* R1 E; B* ^- J
    while A_i<=30 do begin1 f1 U0 ~8 J0 O( _5 r) t' w. J
        travel to pickaisle.con(A_i): n+ V/ C) G. K6 d7 m" D0 m
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; y: }, ]6 T! o2 b/ E* N        else wait for 10 sec
. @' |7 R6 G' V' q$ z        if A_i=A_leave then send to die
2 l: @8 b* O2 R) x        else inc A_i by 1
6 q; @9 ]1 C) D) w- H/ w    end! `: L# a7 h/ c% o/ {* y8 K
end9 U; C8 T. p/ f, ~( F$ ~: }1 Q) T

7 x1 h# w! x' d+ N2 Tbegin P_pick3 arriving
# g2 ^6 A* ]( f7 x    set A_i to 21
  n0 B. y) _3 A: ^    move into Q_induct3
3 L, h3 z8 T& e4 G    move into pickaisle.induct32 [% k/ a; S- B2 G$ ?7 a
    while A_i<=30 do begin
+ s& L6 q; ~. W- u/ ^        travel to pickaisle.con(A_i)
7 p4 C/ P  J5 {& Y( k" D9 S! `        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# D) ?$ [) I" W$ |3 ]        else wait for 10 sec
9 j5 E; }/ {# X# F        if A_i=A_leave then send to die
1 f' I% C9 }# B9 k# \" @        else inc A_i by 1" A2 L# Y) k9 V5 `2 V
    end3 q6 X, v$ m# w; }' r7 o; o
end

最佳答案

查看完整内容

pickaisle.induct1/2/3是个什么东东? move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么? AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。 另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量: 1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
发表于 2009-4-4 23:58:33 | 显示全部楼层
pickaisle.induct1/2/3是个什么东东?& {6 Z2 x" }. G( u$ ]+ q2 I/ Y1 Y' ?
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
6 _2 R, b/ i( p
$ f. n- I- B: R% D' FAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
3 i& \9 j  R9 `5 }  o- a* O: \5 `0 I7 E3 J
' }3 L) R5 K, Y* s( Q另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:7 u/ M+ m& N4 \! z- O# T
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
5 D/ u) F. r. d: f2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;/ D# Y% ~+ X+ S7 N: w
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
0 b: H9 Y6 N4 cbegin P_induction arriving
2 z: Z. Q$ `; K) j, V& \) K    clone 1 load to P_pick(A_induct), i( i/ J- m3 Q6 ~' s4 n. N/ c
end最大的系
% I4 h9 I3 y! b/ v7 w; ^- o8 o' S* ~9 B/ R9 M* k
begin P_pick arriving
% C7 t6 J* W2 V" F7 ]8 c' p    set A_i to procindex * 10 + 1
) M% D' p4 {  V/ s& n% h7 u8 g    move into Q_induct(procindex)$ p4 U. K. f. h! B: m3 l6 z% L
    move into pickaisle.induct(procindex)
! d6 q9 E* [$ w/ z- W1 z% ~' `# o( k# O! z    /*check the type of pickaisle.induct(i), for your last problem.*/
. u0 ]' f# f& y+ o  ?" D, I0 h" w) ~: l. S* \
    while A_i<=30 do begin
0 T4 ^7 ^% z  M- A        travel to pickaisle.con(A_i)% l# c6 E5 F  D
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 F6 t' G6 E$ `! T: g, \( B! f        else wait for 10 sec
, e  G8 |% F. s; R/ j1 S$ C6 N        if A_i=A_leave then send to die  l# N9 a# A% s8 x# v+ O8 \' ~
        else inc A_i by 1( W- |- ^6 O, `5 I, p9 J( O2 w2 F5 e
    end
9 ^! Y5 \. k0 v  \) V; [* U: [1 Q/ Nend
. b4 V& {& E- B4 \6 S% B, E$ ]" X# V# _! _3 h3 z7 Q' R/ z+ I
其中的procindex为整形,代表当前process的序号。: h4 G+ R( d8 p6 \
station和control point只要以数字结尾,都可以直接用作数组。如pickaisle.induct(procindex),当procindex为1的时候,和pickaisle.induct1是等同的。
发表于 2009-4-20 15:33:32 | 显示全部楼层
你的主要错误应该是在move into pickaisle.induct或者 travel to pickaisle.con这两个类型的语句中,因为你的编译说明的意思是类型混淆,你查一下报错的行数,应该就能找到问题,其他的问题慢慢调吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2026-6-17 00:49 , Processed in 0.015057 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表