设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11703|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢- v/ o0 v: d; c. C2 s2 x- \7 N( K
& n, J% G" G  f3 r1 ^: ~! c) S
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
# k7 \  \' K0 b- F6 t+ c" [1 K8 F- T2 K
begin P_read arriving/ Z: l9 N- l3 L6 h, e
    while 1=1 do begin- X/ o1 [3 c% o0 Y) D) u
        read A_tote from "data.txt" with delimiter "\n"- q4 U  f4 N+ ~0 h/ J1 l) u! s
        read A_time from "data.txt" with delimiter "\n"9 }. `4 l) ?2 q) D  `6 X: X( v
        read A_leave from "data.txt" with delimiter "\n"2 b# E5 e6 N1 h2 k: l9 U
        read A_picks from "data.txt" with delimiter "\n"$ K  P% o4 b$ b
        set load type to A_tote, L( @* o  @* j# `& Y9 Z+ U" n
        if A_tote="tote 1" then set A_induct to 14 d; L4 v0 t$ J+ g
        else if A_tote="tote 2" then set A_induct to 29 e1 P9 X) ?, n$ P2 c) @
            else set A_induct to 3    & Q- m7 D0 i+ E* P
        set A_i to 01 {" d; c; {, c# w+ O  o
        clone 1 load to P_induction
& ~! q3 H; o0 Q- w$ a+ Q9 ^* Q  U( K        wait for A_time sec
' u$ I( W( O  b3 x* Y0 i. T    end) ~) }: Z  S% Q" E9 G/ K0 A( ?/ w
end" A0 P. {/ `, _7 `) _0 w( r

( X* H5 b3 n& }- k& Ybegin P_induction arriving
3 K2 n4 B- ~/ v    if A_induct=1 then clone 1 load to P_pick1
& \9 ?) W$ V  y6 r    else if A_induct=2 then clone 1 load to P_pick2+ Y1 M7 t' b0 C% [
        else clone 1 load to P_pick3) Y9 Y. `- D/ @& }1 S
end$ R4 m6 k& ^. W+ |5 r! l7 P2 o

1 T# p2 E( j& |. e" ^& pbegin P_pick1 arriving
! y+ b1 u' n- S    set A_i to 19 D9 }  d+ e3 [" z& s
    move into Q_induct1
5 |9 p' [! J8 I: D; m& A    move into pickaisle.induct1
& J$ |5 H9 p3 h' \/ R4 b    while A_i<=30 do begin9 [5 L3 O( c) B. m8 u; k0 s3 J; l
        travel to pickaisle.con(A_i)
1 k) b9 l& e) l) O5 U9 f  \        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ d! ~/ z0 c& L
        else wait for 10 sec
% A, h0 Y' J: X& E8 L$ v        if A_i=A_leave then send to die! _/ ?* M1 N8 O8 k4 `0 S
        else inc A_i by 1
' A* Y( s5 R; H  w* w    end
  b& z/ L: Y( w( ^end3 {  d2 X6 e9 S& t( Y
6 j' {* h& T9 |% L
begin P_pick2 arriving+ ~, [  t8 M8 r1 E7 s) q! L
    set A_i to 11! F8 M6 v" F; t, d7 p" |
    move into Q_induct2
5 f+ P/ Z5 o$ E5 n* T5 Y    move into pickaisle.induct2# ~- g/ z: l) Z& c7 A, s
    while A_i<=30 do begin
' C7 C. y. [. T# N        travel to pickaisle.con(A_i)
, S9 |0 E9 L+ ]1 r/ o" C2 {5 V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 X+ d. E: ]7 k
        else wait for 10 sec
9 B" [1 r$ u, k) @. J        if A_i=A_leave then send to die& m& e- }5 F% U: Q- w5 O' B4 n0 n9 Q% o
        else inc A_i by 1
2 F, [* w5 Y9 d# ?0 k, c" m+ @    end
0 y! h& ?/ `5 N, Uend
+ `% O* E" z2 W8 c5 I# M9 D/ w7 L
& m4 `' `2 C& r; Q) qbegin P_pick3 arriving
% M# {- r3 F. z2 t% }2 U. m    set A_i to 21
* ?' u; |7 f6 g* `" x    move into Q_induct3
: p( D! W" V# p9 d# |# B    move into pickaisle.induct3
, K# P+ Y9 n$ n3 m" X# A* k$ ^    while A_i<=30 do begin
) Z+ k# I! V3 m4 K6 s  `# |        travel to pickaisle.con(A_i)0 X: N9 w; o0 P7 Q( `
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 H5 s# o) j, ?# x
        else wait for 10 sec
7 Z6 P* _9 Q! a1 S; m4 y        if A_i=A_leave then send to die- s* i8 _2 ~2 b' X
        else inc A_i by 1: I% k; O; B4 h" s
    end$ T! J6 D3 t3 n! f& {0 s* l! ~
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是个什么东东?
* m; @' {. D9 h" X0 |  T3 pmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
! P# _2 X( {- w" h- _0 R. c: |, s$ G  o
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。3 f/ X. F- p# h- Z( ]: R* Y% S* v

" D( N' \: v( |9 T另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
: M9 n. l+ o( A& }, _1 n1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
; m5 X( M% D5 T2 Z2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
9 z, k2 B, O: k" I0 P- a3 L/ [3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:) m$ @5 }2 l$ x/ m
begin P_induction arriving
$ F2 f9 y# ^+ R* j9 e: f/ h( j' S. I    clone 1 load to P_pick(A_induct)2 D! ]; z1 }7 I6 S- z
end最大的系
0 x$ f, x/ u- _$ ]8 U2 ~
& {1 K, X7 k2 G( {) U+ f. Z8 Zbegin P_pick arriving
% M. o, Z0 L- f$ ]9 ~, ^) W( ?    set A_i to procindex * 10 + 15 L! S  k/ A- r& T
    move into Q_induct(procindex)
% s: P/ R6 L! _+ e    move into pickaisle.induct(procindex)# A$ z( m7 ]7 v9 T
    /*check the type of pickaisle.induct(i), for your last problem.*/1 ]. G: A8 M: L
, A# P! p+ ]/ e! i  V( o5 y
    while A_i<=30 do begin
+ Y1 Z) ]0 {2 }2 F  h0 j        travel to pickaisle.con(A_i)
4 L1 m# M/ d; ^        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ B2 G1 l( B: \# _# m( z* T- z        else wait for 10 sec  [- s! y4 x* H% L5 j3 ?3 O4 t5 t$ O
        if A_i=A_leave then send to die' K$ Z6 s$ p( K
        else inc A_i by 1
7 g/ s3 P% k) o6 \7 i1 z' w$ t+ n    end! T+ g# C9 c% A$ f1 o
end
! x# ^& g; W# s% U- p; x" S! a' M1 r4 A* j8 `, F2 `. v
其中的procindex为整形,代表当前process的序号。* Y* e3 I) k) n0 {) B( L
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, 2025-11-28 09:21 , Processed in 0.022289 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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