设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12678|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢* x9 E+ M  p' C8 R* B, o+ [
- S- i( U% A- Q; v
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
. R4 u4 @5 b- F: K+ g3 h) W; S4 u
) @8 K0 E. P, L) [9 f, Ybegin P_read arriving# s) a% u& z1 h
    while 1=1 do begin/ E8 _3 s/ [9 p+ o* P
        read A_tote from "data.txt" with delimiter "\n"
( l/ J: |$ u/ v# l; [        read A_time from "data.txt" with delimiter "\n". x" T5 g2 Y4 ]3 |% T) G7 G8 P
        read A_leave from "data.txt" with delimiter "\n"
; ^' k0 e1 U1 e) z* p3 W# I4 d  e        read A_picks from "data.txt" with delimiter "\n"
6 E; J& j, {7 h# B' Q  k        set load type to A_tote
' p" S& t9 s4 E        if A_tote="tote 1" then set A_induct to 11 r7 Q2 G" ~& E
        else if A_tote="tote 2" then set A_induct to 28 T% b5 p" [- a
            else set A_induct to 3   
. _: D& u& A1 ^1 i# L/ B! V9 W( j/ w        set A_i to 0. |& A9 A( v9 X+ O0 o
        clone 1 load to P_induction& x+ c- G0 F- _# V7 o" [: X) y
        wait for A_time sec
. z/ d7 k# C' f5 X' W% P/ O    end( F6 Z  o  k" D" s
end
* C8 b6 Q7 c( ^
0 t' k' {# T( |9 V5 X7 gbegin P_induction arriving5 e  Z- |5 S1 l2 l0 u7 x
    if A_induct=1 then clone 1 load to P_pick1
0 Z8 K! A# K" x    else if A_induct=2 then clone 1 load to P_pick2
: L. [' t/ y! _4 g3 @& P        else clone 1 load to P_pick3
, F. D( z6 U% [3 Z* xend/ a" P& A, E; V: z9 `% Q( Q% l
  r; m5 |% C4 [4 L% Y
begin P_pick1 arriving# L! N& O) Y" {: h+ G) H
    set A_i to 15 n1 {$ G, D$ G: Y# h9 U1 A$ I
    move into Q_induct1
$ l$ i0 J( L9 g' r0 G2 J4 b    move into pickaisle.induct11 Z! K6 Q/ M' a6 y3 u: U; m# b/ `
    while A_i<=30 do begin$ d& I0 J7 i7 a. V5 L, p2 o
        travel to pickaisle.con(A_i)
$ Z# g0 F5 T9 y& h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( X- ?) X+ C! P/ u: V4 |
        else wait for 10 sec
, B+ v8 K) L1 P; o% G        if A_i=A_leave then send to die
- i3 \% ?( k! W% U6 s5 s        else inc A_i by 1
) y$ b5 e- U, S2 O5 M3 [    end
+ y! w* N! ^  ~# \% Z, L6 V7 q( x5 Send
. c3 j$ ]( H/ n) m8 M6 @8 |' t6 ?5 Q
% y+ ^% i8 b4 U: cbegin P_pick2 arriving
3 h2 ?/ [" h1 ~6 d    set A_i to 114 h$ |4 |% |+ d$ e" p4 e4 @
    move into Q_induct27 h6 V9 W6 L; T% S# k- q
    move into pickaisle.induct2+ O9 d; N# d5 a4 B+ s
    while A_i<=30 do begin/ ~7 W! k1 m9 x3 p" l/ [
        travel to pickaisle.con(A_i)" H" ]. B# |4 O7 j
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( N1 }+ z' A+ L9 W        else wait for 10 sec- b8 [  ~1 {( @. _. b) v
        if A_i=A_leave then send to die4 U5 r& b/ X; ^% a/ N
        else inc A_i by 1+ d. I( n+ S. Q; ^1 v5 P
    end
& ]0 s: \! e+ b+ _$ X3 Mend
8 N- Q; n% ?3 c! b+ a, Q0 Q/ d" s; V3 E( j0 g  b/ g
begin P_pick3 arriving
* E3 a/ b2 i/ `! {- P6 L    set A_i to 21! H" H  |2 U. O' B8 R0 x
    move into Q_induct36 U6 m5 ]" K6 n0 e4 U. ?
    move into pickaisle.induct3
( Y7 R6 ?% _3 Y: a    while A_i<=30 do begin
; t& ?: m" g# B: G2 k- E$ _        travel to pickaisle.con(A_i)7 k( r* T# l2 y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 e* X4 Q! ?1 ]- C& o3 T4 l' {* U        else wait for 10 sec
) ]* V0 t& e  j$ S        if A_i=A_leave then send to die
6 {% T7 d6 T" Q. {$ q& L        else inc A_i by 1( v: s8 `+ B; f: k$ R; q, B
    end
- `$ _5 t: @4 ]7 z% p( d  W# y2 m! vend

最佳答案

查看完整内容

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是个什么东东?9 [! {# L4 k& E% L& d! A( }. U7 e
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?$ N0 m. o/ `7 d6 W, @- O2 S

3 R  N  U7 H7 W4 ]AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。* }4 m, K  V0 `
2 O+ ^. |( @7 Z$ V, l
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
8 _5 s; i- G; F7 V1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
" z8 h( I  b2 X4 q5 s. @  V4 ~0 N% e% M2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
+ c0 u( c/ M/ {2 G% \6 q4 P5 d3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:0 a3 Z* w  v" b
begin P_induction arriving8 l- M% @" _) Q7 _8 U8 O+ Z
    clone 1 load to P_pick(A_induct)
* d. V# y3 S! o6 ]end最大的系6 ~, g6 R- H  w

# O2 j7 p8 j" j/ o) t1 y" z2 xbegin P_pick arriving$ _: ~  n" p( w# ]
    set A_i to procindex * 10 + 18 I4 V( F( S% O
    move into Q_induct(procindex)
% n5 S. i* h: s# _1 R3 |    move into pickaisle.induct(procindex)
* \( z7 c* C! ]3 m    /*check the type of pickaisle.induct(i), for your last problem.*/
3 z" J8 a. `+ m" C! e6 N. F0 s  A! v: D4 R/ G( N/ ]# G
    while A_i<=30 do begin0 c4 h/ V3 Z/ {% w/ S
        travel to pickaisle.con(A_i); I: y/ d5 B7 v. @# i( X
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* y1 \. S/ N9 K; C/ U5 r        else wait for 10 sec. a, B. @- P1 J7 v/ `
        if A_i=A_leave then send to die) z. c% K& X9 h/ a& L7 ]' W
        else inc A_i by 1
# ]$ C: m5 z# D& l    end) y/ x) y  H, E( @' g
end5 G3 J+ G( q6 d* @5 k

" Z% \+ a( P5 e$ |8 m% f% h其中的procindex为整形,代表当前process的序号。/ U" w4 s; d. T( |( Y, \& J
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-2-10 04:30 , Processed in 0.015312 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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