设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14632|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢0 ]3 c* V' d# ]* C! k
+ w, B1 i% c7 F, G5 j  @& q/ K. ~
我的问题是,在每个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中的数值,不知道会不会有什么不妥。7 I$ X; O4 l& C: ]
% i  U9 @. T0 I' p2 M7 Q& k
begin P_read arriving5 d. S  @9 ^# B5 U- v; k
    while 1=1 do begin6 X" N4 X% @- o+ u2 e% T
        read A_tote from "data.txt" with delimiter "\n". g, b- e/ L( S
        read A_time from "data.txt" with delimiter "\n"
. m/ z) C$ w/ g+ I- w6 t  `2 k        read A_leave from "data.txt" with delimiter "\n"; ?- R$ p: r- L3 I. Y4 ?
        read A_picks from "data.txt" with delimiter "\n"
9 h5 n! D  x6 F; g5 w        set load type to A_tote+ V" F2 }/ W1 I; O- v. _# d, x
        if A_tote="tote 1" then set A_induct to 1
; e; {  ]% l6 q/ Z/ P$ R        else if A_tote="tote 2" then set A_induct to 2
& A$ ^  T; j: b5 r            else set A_induct to 3   
' r) |6 U7 h8 l* I5 z  |  r        set A_i to 0
* F  @1 M3 }0 ^9 h        clone 1 load to P_induction5 Z6 U& r8 c) `) U1 C
        wait for A_time sec
: p* u$ v; B' P) T  @' H0 N    end
8 i( O; b, E( @  R. S  Yend+ d, {* {, J, }) h6 q; J4 J" v
$ h" g! }7 v6 ~4 I7 m9 y
begin P_induction arriving, ]0 b% X6 A6 V6 ?8 t
    if A_induct=1 then clone 1 load to P_pick14 w1 u0 T7 [2 Y
    else if A_induct=2 then clone 1 load to P_pick2% f3 V9 L$ J' b4 w' H
        else clone 1 load to P_pick3. d( a8 \- l3 r9 X( `
end
$ \) Z8 P& @8 V7 @$ \9 W% u4 v) u+ r
! R# w+ `; T: y, a. z# Hbegin P_pick1 arriving
* u7 b8 M; z6 \7 q9 F    set A_i to 1
' V" s) t3 O+ X" S7 m) }8 k" }9 o    move into Q_induct1
" G; o4 b. C& i5 u$ q" ^    move into pickaisle.induct1
2 [  Z! T1 ^5 ~- m. j7 u# H, L    while A_i<=30 do begin5 m5 M# U; ~& J
        travel to pickaisle.con(A_i)
' x1 H+ s0 r( B" v: A; x, m$ x        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; h/ M7 _4 Q9 K& t/ {
        else wait for 10 sec/ B. A: N0 ^! |. ^0 s% X( {& {
        if A_i=A_leave then send to die
+ e. h% p/ O) j! e' e6 X% `        else inc A_i by 14 n0 u' p) ?' `; l0 k* ]1 |; L
    end" l" W6 G1 K& x9 E. @5 y
end" T; Q3 `' z( D

3 C% X; N, C) Abegin P_pick2 arriving
+ w+ i) S4 O! C7 m( Q) c. d    set A_i to 118 u1 p& g) @( k6 A
    move into Q_induct20 `5 f8 Y4 a5 j/ c' z
    move into pickaisle.induct2' ~( k, g3 c# }7 N' B
    while A_i<=30 do begin
7 X/ K  |% N1 X7 m4 i        travel to pickaisle.con(A_i)
2 F1 ?5 K$ b5 g( T8 R; @2 M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 X% q4 [: V, f) J2 V9 Z0 W! v
        else wait for 10 sec
1 N1 N5 Y# p, v0 @$ v" S        if A_i=A_leave then send to die
, X: L5 T; T1 e# {. q8 f/ j        else inc A_i by 1& ^0 w- q8 g% V) B" e* K$ T! q* `
    end" D1 G- j/ @5 x: T* P# k
end
) h8 h" V* B8 [/ n. I- C
- Q2 G+ i9 K6 y3 |begin P_pick3 arriving
9 h8 _8 y( s$ C( [/ |8 O    set A_i to 21( N6 J6 _" U7 Y7 y0 E4 F
    move into Q_induct3
: ]/ y, A8 r- P    move into pickaisle.induct3
) |' W- p9 o  @4 i( ?5 b    while A_i<=30 do begin
- C! |; M3 c. i) m' U        travel to pickaisle.con(A_i)
% w$ i) `* i0 q3 C0 ^8 K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 {9 {* p! `% y, _1 g
        else wait for 10 sec) s- c, E& i7 q( i
        if A_i=A_leave then send to die, P6 @/ i4 W9 q3 O/ B& W) K( v
        else inc A_i by 1" S5 \" T/ p- D4 z; G! J
    end" c( i) d. q' F4 ^  k$ ~2 N
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是个什么东东?
0 e" {' r/ R, V2 l# T! m  Qmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?) ?3 T) D# g* n3 k4 I# @

. S1 X9 L5 q! k6 wAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
) d6 x$ i* n4 @
4 J, {: l2 {  b另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:, X4 B2 Q  e( E1 `' y
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;# V$ L$ a* o- q; B& X' |- D% K, {/ A- J
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;) {2 x  n. Q% I' n
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:: e1 q' {% }, J* d
begin P_induction arriving; O; _5 n/ |$ u6 S9 w3 ~1 f9 N
    clone 1 load to P_pick(A_induct)
; j! R, }" q0 F# {; Bend最大的系0 d* q3 a: ]% u% G3 o4 Y
0 [! ~0 N, e8 D0 m6 V$ t
begin P_pick arriving' J" ?: o( ^6 @* Z- K
    set A_i to procindex * 10 + 1
- ], N2 \6 w5 i  A    move into Q_induct(procindex)
( B) x" L4 ]# Z5 ]4 h5 v2 ^    move into pickaisle.induct(procindex)1 D! `$ u6 Q( E4 h2 K& R; E6 J7 {
    /*check the type of pickaisle.induct(i), for your last problem.*/1 f* v$ |! M0 W* U( P' y1 @. _
6 q* W9 H5 `" t& p' t
    while A_i<=30 do begin
3 |- y) z6 I" J# t% p        travel to pickaisle.con(A_i)
. U. l8 }: h8 {0 y. t- T: b0 e4 `* ^        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 Y9 A; _& m) P2 E        else wait for 10 sec
# O6 b# _7 k% f: U! y        if A_i=A_leave then send to die# r7 a' ^3 T! t1 h2 X$ E
        else inc A_i by 1
2 x9 X% l0 E( W* }0 F4 b  g( e0 `/ @, e    end" B( K6 w* T3 ~( F
end1 G+ E2 W% h' u. o& G5 ]

, m2 |0 d# C3 T9 k其中的procindex为整形,代表当前process的序号。, Y2 a4 g$ L" A& O3 v
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-7-19 07:45 , Processed in 0.013556 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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