设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11197|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 I6 d1 J2 C3 \. j( j9 J
: Q5 f9 c( _- t我的问题是,在每个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中的数值,不知道会不会有什么不妥。6 P4 m2 Q  x% T! O1 g
: ]6 V. q" s+ q6 x0 @) I( S
begin P_read arriving
+ P5 S8 H! J4 b4 s6 k2 S0 v! l    while 1=1 do begin
* H* A- k0 a. ]$ K2 ~; S6 a        read A_tote from "data.txt" with delimiter "\n"* B% R, z5 Z. I  d" D8 Y* u
        read A_time from "data.txt" with delimiter "\n"' W  [- G1 H( q( w5 P' a9 _
        read A_leave from "data.txt" with delimiter "\n"
/ M* d- n9 q, [4 B, K# ~        read A_picks from "data.txt" with delimiter "\n"
( j* H  w' N5 h* A. O: \  p% _        set load type to A_tote
2 n% k2 ?6 k  W( I3 @5 `) g  f# N, M        if A_tote="tote 1" then set A_induct to 1
; C/ s4 r8 W* u        else if A_tote="tote 2" then set A_induct to 2! `' o- J' k4 e. q1 B! S0 u2 k5 W4 J
            else set A_induct to 3   
3 J6 M! x7 x7 m/ \' r- J# L        set A_i to 0
9 H2 l' J$ n) v, \( |" g- h0 q4 y        clone 1 load to P_induction
0 E- f/ l6 j2 _        wait for A_time sec3 O( y* C: y( l9 T
    end. M$ A; }, D1 t7 R5 [- d
end" [& N* t6 W" `' K5 e- M
. H) g" W. p0 J7 F9 \
begin P_induction arriving
$ d; c  q* S2 t0 [- H    if A_induct=1 then clone 1 load to P_pick1
- Y/ A1 I) `2 K; ^% f8 R! v    else if A_induct=2 then clone 1 load to P_pick2
  u6 P7 A+ Q& _0 o% B        else clone 1 load to P_pick38 t$ ~4 I6 z8 m  T, u8 @7 v# s
end
/ J3 W' y3 o0 G. I3 o1 G% r! c! B$ i; I
begin P_pick1 arriving
+ G" h8 k; g" o4 K  x% R    set A_i to 1: q( }0 {. a& O0 F! `1 G, g
    move into Q_induct1
( w3 i0 u* B' ?4 }& S$ R) _8 Z    move into pickaisle.induct1
, y3 w- J3 _- s* T" D2 E- j    while A_i<=30 do begin
( o! N8 Z8 n9 l        travel to pickaisle.con(A_i)! Z; x5 }1 B: v; U, h' M! Y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! Q0 s  V9 b5 \3 Y        else wait for 10 sec
' a$ |- h3 L8 `4 U- J3 e2 [6 i        if A_i=A_leave then send to die
9 F2 g) T% \& P/ t; ~        else inc A_i by 1* R) W( U. y, h0 _1 }9 H
    end: e# a2 h* {/ D7 D& ~; u7 p1 ~) U0 f
end
  k3 w5 \" |% M5 y0 t- O9 J0 o! ^7 }( o/ @
begin P_pick2 arriving. c4 E) l2 W; B& O, L: [
    set A_i to 11
6 `0 S% k, Y9 N) k# H% C    move into Q_induct2
2 g- R5 O. o" z0 ~    move into pickaisle.induct2. n+ |$ O) J: j9 J. O% t+ w; i5 y) ^
    while A_i<=30 do begin! b8 V1 ]+ Z# l2 f
        travel to pickaisle.con(A_i)1 i" y/ G6 L* {0 N1 F
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; b/ O, ?$ U; x& o
        else wait for 10 sec
8 r7 L# ^/ g3 U8 C0 Y& V! t        if A_i=A_leave then send to die0 _8 [7 b) M) O2 i+ H5 c$ E
        else inc A_i by 1
, f( Y: ~8 f7 f4 ^" ^# O    end- K" j! Z" m; q
end5 S7 J! d5 Y5 s) t3 |0 C, G

) a5 }5 Z3 I  [3 s9 Cbegin P_pick3 arriving
- ~: C, [7 d* }- W) B    set A_i to 21
4 S, s# l0 P9 S1 \+ i/ }, {; Y& v    move into Q_induct35 j2 [; ?2 A. M' `* j
    move into pickaisle.induct3/ }: [9 u. @- g3 l4 i9 t, ~  c
    while A_i<=30 do begin
; |/ n3 }# n$ ]" ^2 P. h- C        travel to pickaisle.con(A_i)
+ l; o* h2 g# ^- T( ?3 X        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' s: y0 c* k5 C0 P9 l0 \: n9 D
        else wait for 10 sec
  S* q$ n% n- _# c0 _  w+ ^6 R        if A_i=A_leave then send to die
/ e3 s% Z, x0 O        else inc A_i by 19 \3 T7 o1 i- J' r& [0 a6 D
    end
2 Q0 A! z3 b7 G7 a/ b* send

最佳答案

查看完整内容

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是个什么东东?! Q8 }. l2 R6 E, h
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
, L/ {" z( `' l) s# g( Z8 t  N" G9 o
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
- U4 p6 D& s& q; D. v! t
5 _- ]8 _# K" F1 w另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:) P! g- ?1 T9 k. _( n
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;$ R; {+ |$ `$ t- x# j
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
; W# ^; O  a! h  g1 Y1 f3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
9 d  @& z( v' ?8 F9 C9 qbegin P_induction arriving& b* ?0 t" |4 m+ l: ~
    clone 1 load to P_pick(A_induct)
  Q/ n' I9 q. y2 s' S6 Fend最大的系4 K/ ^/ ?0 Y$ S" C% @! e
* ~5 I8 G" h* o5 v/ n, N
begin P_pick arriving
  E2 ^, w: G/ V; M, C8 |; ~    set A_i to procindex * 10 + 1
- j/ u, ~  P, [# d6 L6 |, h    move into Q_induct(procindex)' ~1 {5 O; ~% E. x7 f  U  t
    move into pickaisle.induct(procindex)
$ y/ [- G" n2 s9 m0 X5 Y    /*check the type of pickaisle.induct(i), for your last problem.*/. P: _4 Q% l4 ?( E- d7 M

2 v' M6 r; \, R" s    while A_i<=30 do begin3 Q: P! j6 J: o0 ~- k
        travel to pickaisle.con(A_i)
2 K% y! Q# x4 q! @% S1 T9 [9 K" U5 y3 o        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ ~- Q8 F* S" S: Y& V; I        else wait for 10 sec
9 Y0 L% l2 Y% ]" Z( T/ H+ h9 n        if A_i=A_leave then send to die
9 i) B* l8 X% o2 R4 ^. a        else inc A_i by 1
' O8 V/ s5 A& k$ W" p    end
' E) q0 [7 c1 N  U3 oend
: J: T& z' ?  R1 `6 E. h
- v3 D* U: N$ J3 l1 n- ]$ k4 g其中的procindex为整形,代表当前process的序号。. _2 o- z! a" H$ P: u  D
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-10-29 19:33 , Processed in 0.016206 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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