设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13887|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
7 o* ^% ~7 k0 v1 s; A7 u
7 I# B! P: \& ]% k: x- L我的问题是,在每个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中的数值,不知道会不会有什么不妥。- B5 O* m2 m7 U; r5 F( t, x
$ H! k. h. f' H
begin P_read arriving1 k, m5 ]0 |  A0 W8 ?
    while 1=1 do begin
' V* q6 F0 ~9 H2 O        read A_tote from "data.txt" with delimiter "\n"$ w* b+ h" ?7 u, ~3 B
        read A_time from "data.txt" with delimiter "\n"& j6 m: g. z2 {" x. T
        read A_leave from "data.txt" with delimiter "\n"0 E' c. q8 k! L8 \+ M& x8 }6 T& U
        read A_picks from "data.txt" with delimiter "\n"4 [. ^& ]  p+ x9 `  g
        set load type to A_tote
1 z. _: d. g: [        if A_tote="tote 1" then set A_induct to 1
3 P# x1 G/ `6 q        else if A_tote="tote 2" then set A_induct to 2
1 l6 u- U5 q: B# r3 m# L+ k7 ]0 i, T            else set A_induct to 3   
! k9 L2 x- d* c' \+ Q        set A_i to 0* i/ Q* z9 B( J" P& g
        clone 1 load to P_induction
* ?$ x' B% P9 W3 P5 w* o$ x        wait for A_time sec
  O7 b8 D0 w, Z3 _) N    end) Y" O6 F$ s8 t
end7 g. Y4 c1 _' D4 h1 z
3 A9 k! c5 S3 R" U7 ?+ K/ K6 b; W
begin P_induction arriving! C8 G7 V8 {5 n" h  N9 N( P
    if A_induct=1 then clone 1 load to P_pick17 r3 e# k/ `0 C+ Z
    else if A_induct=2 then clone 1 load to P_pick2$ e% i2 }: K  h: L, z5 D
        else clone 1 load to P_pick3
* x+ m' C- ]% k- B" Y3 ]+ Bend, I8 ]% V# m6 B

0 r. a- _5 u6 p# d/ \- X/ Y) P* {begin P_pick1 arriving
, a% ]7 w2 V2 Y# `    set A_i to 1
7 _# E' J: P# k9 Q( K& F6 k4 ]# k    move into Q_induct1
% [6 x% G8 w& q4 t7 G0 i    move into pickaisle.induct1
( n& O8 D! N9 \/ d& r# ~: H5 V    while A_i<=30 do begin" }$ p+ {% I! s8 z) a+ ?  W9 b
        travel to pickaisle.con(A_i)+ c! y$ |) I  H9 ]3 V3 p' `
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! r% v1 S9 K1 J2 n0 ]        else wait for 10 sec
7 w. D/ p# Q0 _# [) c$ u        if A_i=A_leave then send to die9 ]0 Y) @8 F* [: N1 {
        else inc A_i by 1; h1 @4 l1 ?: Z0 S% A, @
    end+ [* x) G* N8 B" c+ i
end. d/ W) e" M$ S0 S/ p% f/ J% `3 }
& A% R# k+ {; W
begin P_pick2 arriving
0 U* u- {  R) o    set A_i to 11
" C1 t" p: A2 m/ J; C    move into Q_induct2) F; N  i* R3 D" s
    move into pickaisle.induct2- \+ m4 Q2 f7 s4 [2 C' L
    while A_i<=30 do begin8 M! x: j3 W3 e
        travel to pickaisle.con(A_i)5 }9 ^0 {: q9 I( l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( O, F7 ]  ^% d. h6 _
        else wait for 10 sec
! w$ {& x8 k6 ]2 ?) n        if A_i=A_leave then send to die6 z. L$ m) @8 X3 W$ T* _
        else inc A_i by 19 Q- g8 M* ]7 ~9 X
    end- r5 |' k/ s  M2 H
end4 G! R5 k( m% e0 t7 J4 G0 \  d; m

- B9 T; w- M1 J- T" Zbegin P_pick3 arriving
% |* P, J3 N2 j% C5 k0 r# C    set A_i to 21
3 V% t; w, Q' G. q9 {    move into Q_induct33 G3 g" ], B; e# @) }
    move into pickaisle.induct3, v% Z( o0 x3 I
    while A_i<=30 do begin& y: Z# f. ~; x$ D$ K9 ?
        travel to pickaisle.con(A_i)
2 M: l# k* \/ V9 n) n        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: C' U: G& {: p, @) k9 e7 a
        else wait for 10 sec
4 q6 p( w, ^' W9 w9 b        if A_i=A_leave then send to die
# X  E4 j) X% A% K0 V2 }- c        else inc A_i by 1
0 N4 u" L6 @: X( R7 ]' M1 e    end- W8 G) M- w0 o" c) Z! g# I
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是个什么东东?
: d  J7 `8 `; x* D, mmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
; A1 z8 A" Q5 N
4 f: l2 ]; o! b7 P2 O: _, VAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
% i0 @3 x8 X$ @! Z# G# ?3 k( X% ?) F3 Z5 y" X" v
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
& E0 _* _) S  d, o' K9 Z  ?1 f1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
# n( C- j, J5 ?7 r& X: s* Y# _2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
# N' K' K) x* H3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:5 q6 R* U) l! E& a! y- l8 _3 H2 C
begin P_induction arriving  f% z4 L1 U* B  w4 U
    clone 1 load to P_pick(A_induct)
* e. Z) [* U$ j# v' Tend最大的系
% y6 f, m( g$ L1 Y
3 E. X7 T" n& I3 G" t3 _6 Pbegin P_pick arriving/ c4 ]" {" b4 a( ?: m
    set A_i to procindex * 10 + 19 ]4 X6 U2 B9 b9 P. u9 y
    move into Q_induct(procindex)3 |( ]* u4 f: o& \* p+ {
    move into pickaisle.induct(procindex)* G+ n% a! x# h- ]' v
    /*check the type of pickaisle.induct(i), for your last problem.*/
( D4 g$ s3 [4 x, s9 w- r$ B" k* s$ b" @, r% T" Z$ E$ ~7 f
    while A_i<=30 do begin. i: X- {: ?. U. Y3 u) C" u7 ]( D
        travel to pickaisle.con(A_i)# v5 n/ x* \2 z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  u: G! E! x, ^" a
        else wait for 10 sec' H6 P+ a6 b# g! y5 j+ g8 p
        if A_i=A_leave then send to die
* w$ b7 U. t7 X        else inc A_i by 18 w4 r% L$ ^8 Y$ t) _
    end  t$ l1 H; c6 o  [7 w" S
end& j, k4 ?& }: }  E
  g9 z5 v# G+ l$ Q9 z+ G  K
其中的procindex为整形,代表当前process的序号。
% M7 u/ s6 X" [' x1 dstation和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-5-14 16:41 , Processed in 0.018790 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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